Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Top 10 things to read when your flight is canceled

by bart (Canon)
on Mar 14, 2007 at 11:36 UTC ( [id://604781]=note: print w/replies, xml ) Need Help??


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 disadvantage to Readonly is that it isn't optimized away, if it was possible. For example:
use constant DEBUG => 0; print STDERR "foo = $foo\n" if DEBUG;
The second statement gets optimized away. But in
use Readonly; Readonly::Scalar $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.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://604781]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-29 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found