So I'm writing a mildly complex program, and I want to print out some flow information in a few places. I whomped up the following
sub debugprint {
if (defined ($DEBUG)) {print scalar localtime , " : ", @_};
}
and would appreciate any thought's y'all might have.
whenever I need to do some traces, I just change
my $DEBUG; to
my $DEBUG=1;
I am aware of perl -d, but it's a little more than I need right now. I'm just interested in things like
debugprint ("Now entering mysub...\n");
debugprint ("parameters are @_\n");
etc.
Comments?