Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Using Shift with Parameters in a subroutine

by bibliophile (Prior)
on Oct 20, 2014 at 14:09 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-19 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found