APM: How to find out my current subroutine name?
Larry Hunter
lhunter at lhunter.com
Sat Apr 12 09:00:50 CDT 2003
The bighorn book says you want (caller(0))[3] .
caller(0) gives a list of things and the subroutine is the fourth element.
At 02:42 PM 4/12/2003 +0200, Richard Lippmann wrote:
>Hi, for debugging purposes I want to find out the name of the current
>subroutine. How can I find it out?
>
>I usually do this, which is poor:
>
>sub drink {
> my $subr = "drink";
> printf "%s is not yet implemented\n", $subr;
>}
>
>I tried caller(0), caller(1),... but it never tell me the subroutines name.
>Thanks for hints,
>Horshack
>
>--
>Richard Lippmann, Findus Internet-OPAC
>Findus, see http://www.hultsfred.de
>Private, see http://lena.franken.de
>
>_______________________________________________
>Austin mailing list
>Austin at mail.pm.org
>http://mail.pm.org/mailman/listinfo/austin
------------------------------------------------------------------------
Larry Hunter lhunter at lhunter.com http://lhunter.com/
More information about the Austin
mailing list