in reply to Re^2: Using grep to pick out Specific lines in a text file
in thread Using grep to pick out Specific lines in a text file

As a first building block, here is a piece of code that reads from the __DATA__ segment and prints a line if one of the patterns fit. Please confirm if this is what you wanted. Some characters in the patterns need to be escaped with backslashes to make it work.

use strict; my @patterns = ( 'unknown type\(0x134e\)', '30.6511', '\(V6.5.1 FP1\)' + ); my @array = <DATA>; foreach my $line (@array) { print $line if scalar grep { $line =~ /$_/ } @patterns; } __DATA__ no fit unknown type(0x134e) bla bla bla 30.6511 kkkkkkkkkk (V6.5.1 FP1) lllkjlkj 30.6511 klljklljk jkljkljkl