Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Multiple check in If statement ??

by anniyan (Monk)
on Jul 11, 2005 at 07:06 UTC ( #473851=note: print w/ replies, xml ) Need Help??


in reply to Multiple check in If statement ??

You change it like this if you want to match everything else use || to satisy atleast one.

You see perlop.

$a = "a"; $b = "b"; $c = "c"; $d = "d"; $e = "e"; if (($a eq "a")&& ($b eq "b")&& ($c="c")&& ($d="d")&& ($e="e")) { print "success"; } else { print "failure"; }

Regards,
Anniyan


Comment on Re: Multiple check in If statement ??
Download Code
Re^2: Multiple check in If statement ??
by ysth (Canon) on Jul 11, 2005 at 15:59 UTC
    if (($a eq "a")&& ($b eq "b")&& ($c="c")&& ($d="d")&& ($e="e")) {
    You have some = there that should be eq.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-08-22 14:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (158 votes), past polls