Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: comarison synthax question

by thezip (Vicar)
on Apr 11, 2007 at 20:47 UTC ( [id://609476]=note: print w/replies, xml ) Need Help??


in reply to comarison synthax question

Actually, neither will currently work, but the second option is closer to what you want to do.

You'll need to use either 'and' or '&&' to conjoin the logical expressions, which must be explicitly stated as you did in the latter code.

if (($STATUS1 =~ m/^Running$/i) && ($STATUS2 =~ m/^Running$/i)) { + print "match\n"; ^^ }
You could also use:
if (($STATUS1 eq "Running") && ($STATUS2 eq "Running")) { print "match\n"; }

... if you could expect the upper/lower case not to change. You've already tightened it down pretty hard with /^...$/, so a test for equality might also be appropriate.


Where do you want *them* to go today?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 05:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found