Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: string matching

by Anno (Deacon)
on Sep 21, 2007 at 21:26 UTC ( [id://640443]=note: print w/replies, xml ) Need Help??


in reply to string matching

You could use quotemeta() to make the regex work, as has been noted. Since you are searching for a fixed string, the index() function offers itself as a simpler tool that does the job. There is no need to quote anything because index() treats all characters equal.
if ( index( $_, $flag) >= 0 ) { # found it
Anno

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (None)
    As of 2024-04-25 00:00 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found