Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: string does not contain

by broquaint (Abbot)
on Jan 22, 2003 at 15:37 UTC ( #229049=note: print w/ replies, xml ) Need Help??


in reply to string does not contain

Just use the negated version of the regex match operator !~ e.g

my $string = "foo bar baz"; print "no hello" if $string !~ /hello/; __output__ no hello
See. perlop for more info.
HTH

_________
broquaint


Comment on Re: string does not contain
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (17)
As of 2015-07-29 13:41 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 (263 votes), past polls