Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Using Shift with Parameters in a subroutine

by bibliophile (Parson)
on Oct 20, 2014 at 14:09 UTC ( #1104445=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using Shift with Parameters in a subroutine
in thread Using Shift with Parameters in a subroutine

If you just want to scoop the first couple of parameters, you can do something like this:
sub f { my ($x,$y,@z) = @_; print "$x\n$y\n@z\n"; } f("first","second","third","fourth");
Prints:
first second third fourth

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1104445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-01-16 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?