Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 studying the Monastery: (7)
As of 2020-09-28 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (144 votes). Check out past polls.

    Notices?