in reply to match with exception
Of course, that assumes a regular expression is the best way of (not) matching your string -- if it's just a simple string, then the perl function index() may be more suitable.#!/usr/bin/perl use warnings; use strict; use Data::Dumper; my $string = "asdfxyzasdf"; print "Not found\n" if($string !~ /xyz/);
|
---|