in reply to Re^2: Top 10 things to read when your flight is canceled
in thread Top 10 things to read when your flight is canceled
The second statement gets optimized away. But inuse constant DEBUG => 0; print STDERR "foo = $foo\n" if DEBUG;
the last statement is not optimized away, and the test is indeed performed every time the statement is encountered.use Readonly; Readonly::Scalar $DEBUG => 0; print STDERR "foo = $foo\n" if $DEBUG;
Even worse: a Readonly variable is a tied variable, so the test will be slower than it would have been if it wasn't Readonly.
|
|---|