Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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


    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040774]
and !@monks...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2017-02-25 19:08 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (367 votes). Check out past polls.