Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: perlsub prototype sub(_) sub foo(_)

by farang (Chaplain)
on Jun 30, 2013 at 07:32 UTC ( #1041554=note: print w/ replies, xml ) Need Help??


in reply to perlsub prototype sub(_) sub foo(_)

From perlsub:

As the last character of a prototype, or just before a semicolon, a @ or a % , you can use _ in place of $ : if this argument is not provided, $_ will be used instead.

So I guess _ being the only character in the prototype, is also the last, and is equivalent to $ there.

Update: I see from the response of Athanasius above that my guess is slightly off. I didn't quite understand what the documentation is saying.


Comment on Re: perlsub prototype sub(_) sub foo(_)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2015-07-30 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls