Re: Perl Special Variable Containing the name of the method currently in?
- From: nolo contendere <simon.chao@xxxxxxx>
- Date: Fri, 30 May 2008 11:10:53 -0700 (PDT)
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,
.
- References:
- Prev by Date: Perl Special Variable Containing the name of the method currently in?
- Next by Date: Re: Need help with a simple (I think) Perl script
- Previous by thread: Perl Special Variable Containing the name of the method currently in?
- Next by thread: Re: Perl Special Variable Containing the name of the method currently in?
- Index(es):
Relevant Pages
|