Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^4: Pattern matching regex problem

by bibliophile (Prior)
on Nov 23, 2021 at 15:00 UTC ( [id://11139055]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Pattern matching regex problem
in thread Pattern matching regex problem

Or, if you don't care about tr///:

if ($s =~ /M/) { print "case1\n"; } else { print "case2\n"; }

Replies are listed 'Best First'.
Re^5: Pattern matching regex problem
by ikegami (Patriarch) on Nov 23, 2021 at 21:00 UTC

    tr should be faster, though.

Log In?
Username:
Password:

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

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

    No recent polls found