Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: @_ & @ARGV

by moritz (Cardinal)
on Oct 07, 2012 at 14:48 UTC ( #997681=note: print w/ replies, xml ) Need Help??


in reply to @_ & @ARGV

@_ contains the arguments to the current (inner-most) subroutine, which is why the @_ in the inner subroutine is different from that of the outer subroutine. shift acts on @_ by default, which is why it gets the first argument to the inner-most function.

Strictly speaking,

my @list = @_; print @_, ' out return', "\n";

is the only content directly in sub formatlist, the rest is in an inner functio which has its own @_.


Comment on Re: @_ & @ARGV
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2014-10-20 22:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (92 votes), past polls