Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: And plus OR

by AnomalousMonk (Archbishop)
on Jan 12, 2017 at 21:40 UTC ( [id://1179474]=note: print w/replies, xml ) Need Help??


in reply to And plus OR

What does "does not work" mean?

c:\@Work\Perl\monks>perl -wMstrict -le "my $username = 'phil'; my $security = 'phil'; my $type = 'foo'; ;; if (($username eq qq{$security}) && ($type ne 'Check In' || $type ne +'Check Out')) { print qq{\$username and \$security are '$username'}; print qq{\$type is '$type'}; } " $username and $security are 'phil' $type is 'foo'

Update: Please see Short, Self Contained, Correct (Compilable), Example.

Update 2: After looking at tybalt89's guess about your difficulty, I think it's likely right: you're expecting the expression
    $type ne "Check In" || $type ne "Check Out"
to be false sometimes, and it can only be true.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-20 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found