Perl Programming/Keywords/unshift
Appearance
The unshift keyword
[edit | edit source]unshift does the opposite of shift. It prepends list to the front of the array and returns the new number of elements in the array.
Syntax
[edit | edit source] unshift ARRAY, LIST
unshift EXPRESSION, LIST
Example
[edit | edit source]unshift(@ARGV, '-e') unless $ARGV[0] =~ /^-/;