http://www.perlmonks.org?node_id=72748


in reply to Re: Re: NEWBIE Brain Teaser #2, by nysus
in thread NEWBIE Brain Teaser #2, by nysus

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 @_.

--
Me spell chucker work grate. Need grandma chicken.