Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: regexp operator -- same mistake over and over again

by Anonymous Monk
on Jan 25, 2004 at 07:20 UTC ( #323940=note: print w/replies, xml ) Need Help??


in reply to regexp operator -- same mistake over and over again

Best way to remember the order is to remember the order for NOT matching, ie !~ You never have a NOT exclamation point which is not at the start of the operator. Of that you can be sure. So, the matching operator must be =~ rather than ~=
  • Comment on Re: regexp operator -- same mistake over and over again

Replies are listed 'Best First'.
Re: Re: regexp operator -- same mistake over and over again
by seattlejohn (Deacon) on Feb 07, 2004 at 20:14 UTC
    Yes, this worked for me too. The order seemed completely unnatural when I was first learning Perl but I sort of told myself that ~ is the regex binding operator and the = or ! is a modifier that indicates whether the binding is to be construed as an affirmative or negative one. Pretty kludgy but became second nature soon enough.

            $perlmonks{seattlejohn} = 'John Clyman';

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2023-03-25 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?