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


in reply to Re: Scalar context changes bareword value?
in thread Stumped when passing barewords

Thanks for the explanation! I can just pass $_[0] in this situation, which should make it work. However, if there would be multiple parameters and I wanted to pass @_ as a whole, there'd be a problem :(.

Replies are listed 'Best First'.
Re: Re: Scalar context changes bareword value?
by Fletch (Bishop) on Apr 22, 2004 at 13:45 UTC

    Well, not a problem but you'd have to call it as sub2( $_[0]  => @_[1..$#_] ). Then again, you play with prototypes you're going to get burned. Or was that matches . . .