On 22 Jun 2001 16:26:43 +0200, Aaron Craig wrote:
> At 09:49 22.06.2001 -0400, Yacketta, Ronald wrote:
> >Folks,
> >
> >Is this syntax correct for finding multiple words in a line?
> > $results{$test}++ if /$test/ && /Factory/ && /failed/;
>
> Looks good.
>
> >also, what would the syntax be to find a word in a line that does
> >not contain another word? something similar to
> > grep joe output | grep -v fred
>
> $results{$test}++ if($_ =~ /joe/ && $_ !~ /fred/);
> Aaron Craig
> Programming
> iSoftitler.com
>
>
I think you can write this as
$results{$test}++ if (not /(joe|fred)/);
--
Today is Pungenday, the 27th day of Confusion in the YOLD 3167
Fnord.