Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by bunnyman (Hermit)
on Jan 22, 2004 at 22:14 UTC ( [id://323338]=note: print w/replies, xml ) Need Help??


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

Makes sense to me. Every other operator with the 'equals' in it has the 'equals' last, e.g. += or *= (Otherwise $foo =+ 20 would be parsed as $foo = +20)

The =~ is the opposite and that makes it confusing.

Replies are listed 'Best First'.
Re: Re: regexp operator -- same mistake over and over again
by Anonymous Monk on Jan 23, 2004 at 12:23 UTC
    by analogy with +=
    $foo ~= s/a/b/;
    should be equivalent to
    $foo = $foo ~ s/a/b/;
    so maybe ~ should be a binary operator that returns the result of the substitution whereas ~= would apply the substitution to $foo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-29 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found