Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Stupid mistakes I repeatedly make

by demerphq (Chancellor)
on Mar 27, 2005 at 18:39 UTC ( [id://442676]=note: print w/replies, xml ) Need Help??


in reply to Re: Stupid mistakes I repeatedly make
in thread Stupid mistakes I repeatedly make

ambrus taught me a good mnenonic - the negated comparison for the regex binding operator is !~, which has the same order as !=, and thus, the regex binding operator must be =~.

I use the same mnemonic but word it a bit differently: I tend to translate $a == $b to "a is b", so I translate $a =~ /Pattern/ as "a is like Pattern", and since ! is traditionally "not" I translate $a !~/Pattern/ as "a not like Pattern".

Thus the "=~" operator to me is the "is like" operator and the "!~" operator is the "not like" operator.

---
demerphq

  • Comment on Re^2: Stupid mistakes I repeatedly make

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2025-07-12 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.