in reply to Re^2: Usage of grep on a file
in thread Usage of grep on a file
If the file is large don't slurp it, use a loop to process a line at a time. You could do it this way:
#open file #open outFile while (<file>) { my $line = $_; my $match = 0; for (@matcharray) { ($match = 1), last if $line =~ m/$_/; } print outFile $line if $match; }
|
|---|