|
|
| "be consistent" | |
| PerlMonks |
Re: Debug code out of production systemsby hardburn (Abbot) |
| on Jan 25, 2004 at 04:23 UTC ( #323917=note: print w/ replies, xml ) | Need Help?? |
|
This is really easy to achive. perl will optimize away sections enclosed in if blocks with constant conditions:
So with a false constant, perl will replace the if with a statement B::Deparse doesn't like (but is probably a noop). With a true constant, it gets enclosed in a do block (in case there are any lexicals declared--perl doesn't look ahead far enough to know). (And I say 'perl', not 'Perl', because it's possible that a different implementation of Perl, should there ever be one (Ponie?), may apply different optimizations.) ---- : () { :|:& };: Note: All code is untested, unless otherwise stated
In Section
Meditations
|
|
||||||||||||||||||||||||||