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

Re: string on right side of m//?

by moritz (Cardinal)
on Apr 21, 2013 at 09:35 UTC ( #1029739=note: print w/ replies, xml ) Need Help??


in reply to string on right side of m//?

It's deeply ingrained in Perl that the operators dictate what to do, and not the type of the operands (with few exceptions).

So =~ always does a regex match. If the right-hand side isn't a regex, it becomes one.

Same with . (coerces the arguments to be strings), + (coerces to numeric) etc.

Update: since the question was about documentation, I checked perlop if this was explained somewhere. I didn't find anything, so I've submitted a patch which adds such an explanation.


Comment on Re: string on right side of m//?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2015-07-03 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (55 votes), past polls