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 (Canon) 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