Thanks for the suggestion but no dice. I tried dumping caller() and for the (caller(0))[3], I got the name as 'Mojo::Server::Sandbox::298f9a9f326c0e86354ef9976dc86d73::__ANON__'. So, it seems that the helper code is executed as anonymous sub. Is it intentional to not preserve the helper name (assuming it's not tracked elsewhere)? If not, any chance of preserving the name via named anonymous subs (http://www.perlmonks.org/?node_id=304883)?
On Wednesday, July 5, 2017 at 12:09:32 PM UTC-4, Charlie Brady wrote: > > > On Wed, 5 Jul 2017, Beginner wrote: > > > Henry Foolman, thanks for your detailed reply about authoring plugins -- > > appreciate it. Unless I misunderstood your post completely, my question > is > > really how to figure out the name of the helper function from within the > > helper, perhaps via some nested ref inside $self!? I tried dumping it > but > > quickly got lost, so wanted to see if the community is aware of a trick. > > > Is that even possible? > > See what caller() gives you: > > > https://stackoverflow.com/questions/2559792/how-can-i-get-the-name-of-the-current-subroutine-in-perl > > <https://www.google.com/url?q=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F2559792%2Fhow-can-i-get-the-name-of-the-current-subroutine-in-perl&sa=D&sntz=1&usg=AFQjCNGD4J92eyHzr5OsgcKEJpCc5BDKRA> > > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
