in reply to Perl Matching Question
Replace your comment block with something like
while( <FILE> ) { print "Found $1 in $file; line $. :offset $-[0]" if /(PASS)/ or /(sweeps)/ or /(Final)/; }
You don't say what you want to do if you find a match, or whether a match means you found any of your three words or all of your three words. The above will do the former but breaking the if into 3, setting a flag for each and taking some action (like leaving the loop early) if all 3 flags are set would be one way to do the later.
|
|---|