in reply to Re: Convenient way to track function calls?
in thread Convenient way to track function calls?
Then changing your globlal replace command to:sub debuglogger { my $msg = shift; if ($DEBUG) { print STDERR "$msg\n"; } }
That way you can toggle the output with the $DEBUG var, and do fancy things like adding timestamps or changing where to debugging information goes w/o resorting to another -pi -e command.'s/sub\s+(\w+)\s+{/sub $1 { debuglogger("entering $1"); /'
-Blake
|
|---|