The unshift function prepends LIST to the front of the array.
#Format: unshift(ARRAY, LIST)
# Putting new elements at the front of a list
@names=("Tom", "Bert", "Tom") ;
unshift(@names, "Liz", "Daniel");
print "@names\n";
Related examples in the same category