Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

(lestrrat) Do use 'constant': Re(4): Am I missing something here?

by lestrrat (Deacon)
on Nov 08, 2001 at 23:09 UTC ( [id://124135]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    *DEBUG = \1;
    use constant CONST_DEBUG => 1;
    $DEBUG && print "foo\n";
    CONST_DEBUG && print "bar\n";
    
  2. or download this
    ## Output of perl -MO=Deparse on my machine with perl 5.6.1:
    *DEBUG=\(1);
    ...
    }
    print "foo\n" if $DEBUG; # <- $DEBUG must be evaluated each time
    print "bar\n"; # <- there's no evaluation... just straight print()'ing
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-03-28 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found