The unshift function prepends LIST to the front of the array. : unshift « Array « Perl





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

1.unshift places data to the front of an array
2.unshift array
3.Using unshift to insert elements at the front of @array