Go to the first, previous, next, last section, table of contents.
- `shift(ARRAY)'
-
- `shift ARRAY'
-
- `shift'
-
配列の最初の値を取り出してそれを返す。
そして、配列の長さを 1 減らして全要素をずらす。
配列に要素がない場合、undefined value を返す。
ARRAY を省略すると、
メインプログラムでは
@ARGV を shift し、
サブルーチンでは @_ を shift する。
(これは lexically(?) に決定される。)
unshift()、push()、pop() も参照のこと。
shift() と unshift() は、
push() と pop() が配列の右について行うのと同じことを
配列の左について行う。
See section unshift, See section push, および See section pop.
Go to the first, previous, next, last section, table of contents.