You could use perl -P, but it has limitations. (Update: Direct link to -P)
You could use the if (CONSTANT) construct. When the constant conditional expression is false, it is optimized out, along with the code that would get exectuted if it were true. For example, DEBUG is only evaluated once (even if that piece of code is executed multiple times) in the following snippet, and log is never called by it:
use constant DEBUG => 0; log(...) if DEBUG;
In reply to Re: Seeking defined() for compile time
by ikegami
in thread Seeking defined() for compile time
by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |