in reply to Conditionally executing debugging code
Routine dbg_print prints debug message (in smaller font and dark red color) together with program line and file name where it was called from.
You may want to print some comments about process status using dbg_print as well. Easy to see them if neededsub is_dbgview { return -e 'dbgviewmode.yes'; } sub dbg_print (@) { my @inpar = @_; return 0 if not is_dbgview(); # use caller() to figure out out procedure call stack # with program names and line numbers my $caller = ....; print '<FONT COLOR=firebrick SIZE=-1>', "DBG message from $caller...:, @inpar, '</FONT>'; }
|
|---|