Perl: the Markov chain saw | |
PerlMonks |
Re(3): NEWBIE Brain Teaser #2, by nysusby yakko (Friar) |
on Apr 16, 2001 at 06:33 UTC ( [id://72748]=note: print w/replies, xml ) | Need Help?? |
Because @_ is localised for the subroutine. Since you called subroutine with no parms, the @_ it's operating from has undef. As for &subroutine, @_ is not localised and the existing one is passed in. $_ need not apply outside the sub in any event -- the subroutine deals with @_. --
In Section
Seekers of Perl Wisdom
|
|