- or download this
while ( ($x) = shift @a ) {
...
}
- or download this
DB<170> @a=1..2
=> (1, 2)
...
DB<173> ( ($x) = shift @a ) ? $x : "false"
=> undef # true!
- or download this
DB<174> @a=1..2
=> (1, 2)
...
DB<177> ( ($x) = splice @a,0,1 ) ? "$x" : "false"
=> "false"
- or download this
The following equivalences hold (assuming "$[ == 0 and $#a >= $i" )
...
shift(@a) splice(@a,0,1)