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

Re^3: how to get a subroutine name?

by hdb (Prior)
on Jun 26, 2013 at 12:54 UTC ( #1040774=note: print w/ replies, xml ) Need Help??


in reply to Re^2: how to get a subroutine name?
in thread how to get a subroutine name?

However, __SUB__ returns a reference to the currently running subroutine according to perlsub. Not sure how you will get its name?




Comment on Re^3: how to get a subroutine name?
Download Code
Re^4: how to get a subroutine name?
by tobyink (Abbot) on Jun 26, 2013 at 14:05 UTC

    Sub::Identify?

    Still, that's rather a roundabout way to do things.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2015-07-03 23:26 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 (57 votes), past polls