Is there an easy way when calling a subroutine to determine what called that subroutine?There sure is and it's called caller().
Check out the caller() docs for more info on this funky little function.sub foo { print "calling bar()", $/; bar(); } sub bar { print "in bar()", $/; print "called by - ", (caller(1))[3], $/; } foo(); __output__ calling bar() in bar() called by - main::foo
_________
broquaint
In reply to Re: subroutine tracking
by broquaint
in thread subroutine tracking
by muncher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |