Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: binding operator

by Fletch (Bishop)
on Jul 21, 2020 at 15:52 UTC ( [id://11119609]=note: print w/replies, xml ) Need Help??


in reply to binding operator

Well for one thing your first version is assigning the result of comparing qr/(a|b|x)/i against $_ back into $_. Harmless in this case, but . . .

For another, your second chunk is attempting to match the regex qr{ /(a|b|x)/} against $teststring which isn't what you mean either. When you use the match operator with different delimiters you don't need the extra slashes (e.g. you really meant if( $teststring =~ m{(a|b|x)}i ) {...} there).

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found