[Za-pm] sub name in a special var?
jkeen at verizon.net
Fri Jun 10 17:06:39 PDT 2005
On Jun 10, 2005, at 8:56 AM, Spike wrote:
> Hi All
> Is there a special var that holds, or a function that returns the name
> the current subroutine in the came way that $0 holds the script name or
> caller() returns the calling package?
Yes, it's called ... caller!
From perldoc -f caller
With EXPR, it returns some extra information that the
uses to print a stack trace. The value of EXPR
many call frames to go back before the current one.
($package, $filename, $line, $subroutine, $hasargs,
$wantarray, $evaltext, $is_require, $hints,
$bitmask) = caller($i);
So, is there some reason why element in the above list won't work
More information about the Za-pm