unfortunately there is no macro mechanism° in pure Perl.
If you want code to be folded away at compile-time, you have to put it inside an if(CONSTANT-VALUE) block.
Athanasius already showed you a way to do it.
Tho if you want nicer syntax, you can define a (kind of) macro with Keyword::Simple which only expands the debug-code if a condition is met.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) Lisp like that is
In reply to Re: perl compiler optimizer curiosity
by LanX
in thread perl compiler optimizer curiosity
by smile4me
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |