words to match are variable e.g array @words
On 4/11/06, Sonika Sachdeva <[EMAIL PROTECTED]> wrote: > > $str1=shift; > $str2=shift; > $str3=shift; > > my $querystring="$str1 && $str2 && $str3"; > > foreach (@LINES){ > push @output,$_ if /$querystring/ ; > } > > does not work even if I have @LINES containing all 3 words. > > Thanx, > > > On 4/11/06, Peter Cornelius <[EMAIL PROTECTED]> wrote: > > > > What do you mean by 'works'? It looks to me like this will print the > > line if the string 'pattern1 && pattern2 && pattern3' is in the > > line. Not if pattern1 is in the line and pattern2 is in the line and > > pattern3 is in the line. Is that what you mean? > > > > I think some more detail would help me to understand your question. > > > > > print $line if ($line =~ /pattern1 && pattern2 && pattern3/); > > > > > > works .. but > > > > >