in reply to Re: Using the Perl Debugger (-d)
in thread Using the Perl Debugger (-d)
Debug prints such as yours entail a runtime hit, which is almost always negligible; but they also clutter the code, which often isn't.If you use something like this:
the compiler should optimize it away, which will remove even the small performance hit (or at least relegate it to the one-time compilation of the code).use constant DEBUG => 1; print "Some useful information" if (DEBUG);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using the Perl Debugger (-d)
by MaxKlokan (Monk) on Jan 26, 2007 at 10:33 UTC | |
by bart (Canon) on Jan 26, 2007 at 11:59 UTC | |
by BrowserUk (Patriarch) on Jan 26, 2007 at 12:09 UTC |