in reply to code review: pretty print sub entry/exit

You want transparent? How about just doing this from a (Unix) command line (after removing all your debugging code):

$ PERLDB_OPTS="f=3 N LineInfo=xxx" perl -d imlate.pl Default die handler restored. hello! goodbye! hello! goodbye! i'm late! i'm late! i'm late!

This will result in the file xxx containing your trace:

$ cat xxx Package imlate.pl. entering main::hello entering main::goodbye exited main::goodbye entering main::goodbye exited main::goodbye exited main::hello entering main::imlate exited main::imlate

By changing the settings of the "f=n" option, you can change the printout (from perldoc perldebguts):

In all cases shown above, the line indentation shows the call tree. If bit 2 of "frame" is set, a line is printed on exit from a subroutine as well. If bit 4 is set, the arguments are printed along with the caller info. If bit 8 is set, the arguments are printed even if they are tied or references. If bit 16 is set, the return value is printed, too.

Without the LineInfo=xxx, the entering/exited messages will end up on stdout (like in yours).