The same is valid for shift and @_.my @a = 1..10; { my $s = shift @a; print "$s\n" #result: 1 which is the 1st @a array element } { my $s = @a; print "$s\n" #result: 9 which is the number of @a array elements }
In reply to Re: Subroutines: @_ and shift
by sh1tn
in thread Subroutines: @_ and shift
by ghenry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |