Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: ne vs. ! eq

by haukex (Chancellor)
on Feb 25, 2020 at 13:38 UTC ( #11113401=note: print w/replies, xml ) Need Help??


in reply to ne vs. ! eq

Precedence. See perlop: ! $s1 eq $s2 is the same as (!$s1) eq $s2, and not !( $s1 eq $s2 ), as B::Deparse will tell you:

$ perl -MO=Deparse,-p -e 'if (! $s1 eq $s2) {}' if (((!$s1) eq $s2)) { (); }

You'll need to write either if ( !( $s1 eq $s2 ) ), if ( not $s1 eq $s2 ), unless ( $s1 eq $s2 ), or of course if ( $s1 ne $s2 ).

Replies are listed 'Best First'.
Re^2: ne vs. ! eq
by boerni (Novice) on Feb 25, 2020 at 13:42 UTC
    Thank you very much haukex!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2020-03-29 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (171 votes). Check out past polls.

    Notices?