Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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?



Replies are listed 'Best First'.
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 chanting in the Monastery: (10)
As of 2016-06-30 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (396 votes). Check out past polls.