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; }
In reply to Re^3: Usage of grep on a file
by GrandFather
in thread Usage of grep on a file
by tsk1979
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |