- unshift ARRAY,LIST
-
Does the opposite of a
shift
. Or the opposite of apush
, depending on how you look at it. Prepends list to the front of the array and returns the new number of elements in the array.shift
の逆操作を行ないます。 見方を変えれば、push
の逆操作とも考えられます。 LIST を ARRAY の先頭に入れて、新しくできた配列の要素の数を返します。unshift(@ARGV, '-e') unless $ARGV[0] =~ /^-/;
Note the LIST is prepended whole, not one element at a time, so the prepended elements stay in the same order. Use
reverse
to do the reverse.LIST は、はらばらにではなく、一度に登録されるので、順番はそのままです。 逆順に登録するには、
reverse
を使ってください。Starting with Perl 5.14, an experimental feature allowed
unshift
to take a scalar expression. This experiment has been deemed unsuccessful, and was removed as of Perl 5.24.Perl 5.14 から、
unshift
がスカラ式を 取ることが出来るという実験的機能がありました。 この実験は失敗と見なされ、Perl 5.24 で削除されました。