Don't ask to ask, just ask | |
PerlMonks |
Re^2: Using Shift with Parameters in a subroutineby capstan (Novice) |
on Oct 23, 2014 at 16:34 UTC ( [id://1104797]=note: print w/replies, xml ) | Need Help?? |
Just to be thorough,
my ($one, $two) = _@; works once, but ignores the side effect of shift (removing the arguments from the @_ array).As Marshall says, using a reference to an array would be the best way to deal with a lot of parameters, but if you wanted to, say, process two at a time, you could do (you'll get an uninitialized value warning if you supply an odd number of parameters)
In Section
Seekers of Perl Wisdom
|
|