in reply to Seeking defined() for compile time
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;
|
|---|