http://www.perlmonks.org?node_id=617319


in reply to regex negation without !~

if (!($str =~ /^FOO$/)) { //do something for no match }

Replies are listed 'Best First'.
Re^2: regex negation without !~
by imp (Priest) on May 24, 2007 at 19:24 UTC
    This approach won't work, as he is passing the regex to another module. The regex itself has to evaluate as false.