in reply to perl compiler optimizer curiosity
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: perl compiler optimizer curiosity
by cavac (Prior) on Mar 15, 2022 at 11:11 UTC | |
by LanX (Saint) on Mar 15, 2022 at 11:50 UTC | |
by afoken (Chancellor) on Mar 15, 2022 at 11:58 UTC | |
by LanX (Saint) on Mar 15, 2022 at 12:16 UTC |