in reply to Re: for vs. reverse
in thread for vs. reverse
Yes and no: see shift. This is an example of Do What I Mean (DWIM). Inside a subroutine or format, shift works on @_ by default. Outside a subroutine, however, shift works on @ARGV by default.
#!perl -l @ARGV = '@ARGV'; @_ = '@_'; print '$ARGV[0] = ', shift; mysub(@_); sub mysub { print '$_[0] = ', shift; }
|
|---|