Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

(lestrrat) Re(2): Accessing Constant Hashes

by lestrrat (Deacon)
on Jan 16, 2002 at 02:46 UTC ( #139069=note: print w/replies, xml ) Need Help??

in reply to Re: Accessing Constant Hashes
in thread Accessing Constant Hashes

I personally would recommend using a constant if there's a possibility of constant folding:

#!/usr/local/bin/perl use O qw/ Deparse /; use constant CONDITION => 0; if( CONDITION ) { print "condition true\n"; } else { print "condition false\n"; } __END__ ## and here's the output. notice that there are ## no if's me@myhost> ./ ./ syntax OK sub CONDITION () { package constant; $scalar; } print "condition false\n";;

Otherwise I guess I could care less, but I use it more for a mental note than anything else -- it makes me aware that this value should be a constant

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2020-10-19 16:27 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (205 votes). Check out past polls.