Outaspace has asked for the wisdom of the Perl Monks concerning the following question:
But I would rather use something like:use constant DEBUG => 1; print "Test something" if (DEBUG);
but without the overhead of a function call. I already looked at some modules at CPAN (like Trace), but they allways seem to call functions even if DEBUG = 0 and in a large Perl script it gives me to much overhead (especially when using the DB Module).use constant DEBUG => 1; DEBUG("Test something");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Debug Macro
by Ovid (Cardinal) on Mar 27, 2007 at 09:47 UTC | |
|
Re: Debug Macro
by sgt (Deacon) on Mar 27, 2007 at 09:43 UTC | |
by grinder (Bishop) on Mar 27, 2007 at 11:41 UTC | |
by Ovid (Cardinal) on Mar 27, 2007 at 13:17 UTC | |
by sgt (Deacon) on Mar 27, 2007 at 22:49 UTC | |
by grinder (Bishop) on Mar 28, 2007 at 06:58 UTC | |
|
Re: Debug Macro
by ferreira (Chaplain) on Mar 27, 2007 at 14:47 UTC | |
by Outaspace (Scribe) on Mar 27, 2007 at 21:14 UTC | |
by ferreira (Chaplain) on Mar 28, 2007 at 10:28 UTC |