Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: ne vs. ! eq

by haukex (Archbishop)
on Feb 25, 2020 at 13:38 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11113401]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-24 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found