Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: comarison synthax question

by Krambambuli (Curate)
on Apr 11, 2007 at 20:41 UTC ( [id://609471]=note: print w/replies, xml ) Need Help??


in reply to comarison synthax question

my $STATUS1 = "Running"; my $STATUS2 = "Sunning"; print $STATUS1 & $STATUS2, "\n";
prints 'Running', as R is 0x52 and S = 0x53, but R & S = R

So _no_, don't use '&' unless you know you're working on bits.

I guess you might have it also like
if (lc($STATUS1) eq lc($STATUS2) and lc($STATUS1) eq 'running') {... }
Why not being explicit whenever possible ?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found