in reply to This is just wonky...
use strict; my $exclude = 'middle_name pager zip'; my $lookfor='pager'; my $lookfor2='wonk'; # This would work without using pattern matching: # Note lc function used to ignore case! my $pos=index(lc($exclude),lc($lookfor),0); if ($pos > -1) {print "Found $lookfor !\n";} $pos=index(lc($exclude),lc($lookfor2),0); if ($pos == -1) {print "Cannot find $lookfor2 !\n";} print "\n"; my $look=($exclude =~ /$lookfor/gi); my $look2=($exclude =~ /$lookfor2/gi); my $notlook=($exclude !~ /$lookfor/gi); my $notlook2=($exclude !~ /$lookfor2/gi); print "'\$exclude =~ /$lookfor/gi' evaluates to '$look'\n"; print "'\$exclude =~ /$lookfor2/gi' evaluates to '$look2'\n"; print "'\$exclude !~ /$lookfor/gi' evaluates to '$notlook'\n"; print "'\$exclude !~ /$lookfor2/gi' evaluates to '$notlook2'\n"; __END__
..:::::: aquacade ::::::..
|
|---|