perl -MO=Deparse,-x,-p -e 'sub verbose() { 0 } print "guggug!\n" if ve +rbose;' sub verbose () { 0 } '???'; -e syntax OK
perl -MO=Deparse,-x,-p -e 'sub verbose() { 0 } if(verbose){ print "gug +gug!\n"};' sub verbose () { 0 } '???'; -e syntax OK
The '???'; statements stand for bits of code that have been optimized away; those will have no impact on performance. If the compiler sees such a constant returning sub it can perform optimizations, eliminating code blocks whose execution is bound to the value of that constant.
Besides, before shoehorning a perl script through m4, I'd rather look - though discouraged - at perl's -P switch. See perlrun.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: Macro in perl code?
by shmem
in thread Macro in perl code?
by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |