I usually like to use a subroutine for this and then call it at the beginning of every other subroutine in the script.
sub whoami { print "DEBUG: ".(caller(1))[3]."\n" if $DEBUG > 0; } sub dostuff { whoami(); <snip> }
In reply to Re^2: Two recursive functions returning in unexpected order
by Argel
in thread Two recursive functions returning in unexpected order
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |