in reply to string search

If you're just doing plain substring matching then index() might be a simpler option
if(index($source, 'no such file') != -1) { print "Found it \n"; }

HTH

broquaint

Replies are listed 'Best First'.
Re: Re: string search
by ariels (Curate) on Mar 21, 2002 at 10:25 UTC
    index is case sensitive. You'll probably want to say
    if(index(lc $source, 'no such file') != -1) { print "Found it \n"; }
    to normalise $source into lower case.