in reply to
Finding what called a subroutine
Yes, you can use
caller
:
($pkg, $file, $line) = caller(1);
[download]
Or see
Carp
's croak() and confess().
Comment on
Re: Finding what called a subroutine
Download
Code
Replies are listed 'Best First'.
Re^2: Finding what called a subroutine
by
pemungkah
(Priest)
on Apr 06, 2013 at 10:11 UTC
Very much recommend
caller()
, as educated_foo says; you can get a full stack trace all the way back to the main program if you need it.
[reply]
In Section
Seekers of Perl Wisdom