Re: Perl Special Variable Containing the name of the method currently in?



On May 30, 2:06 pm, Nigel <nigelstu...@xxxxxxxxx> wrote:
Hello,

Just out of curiosity.
Is there a way to get the name of the subroutine Perl is currently in
when it is running?
For example, if I have a subroutine declared with the name sub
helloWorld, is there any way from within that subroutine to
programmatically get 'helloWorld' without having to hardcode it?

yup. caller().

http://perldoc.perl.org/functions/caller.html

HTH,

.



Relevant Pages