Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 examining the Monastery: (4)
As of 2014-09-21 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (166 votes), past polls