caller() is the function you want. A subroutine can get its own name like this:
perl -e 'sub try { print +(caller(0))[3] }; try() '
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
In reply to Re: How can a subroutine get its name?
by clemburg
in thread How can a subroutine get its name?
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |