Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: effects of ampersand and non ampersand when referencing a sub name

by tobyink (Abbot)
on Dec 20, 2012 at 17:55 UTC ( #1009771=note: print w/replies, xml ) Need Help??


in reply to Re: effects of ampersand and non ampersand when referencing a sub name
in thread effects of ampersand and non ampersand when referencing a sub name

The (&) prototype is useful if you're writing subs that expect to be passed coderefs/callbacks. And (_) can be useful too.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009771]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-03-26 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (315 votes). Check out past polls.