Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 having an uproarious good time at the Monastery: (5)
As of 2015-07-05 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls