When reading files, you should generally avoid slurping them into one scalar or array, as this could be quite memory intensive. A
while-loop is almost always a better solution.
Have a look at this and see if it works for you:
open FILE, '<', $filename or die "Cannot open $filename: $!\n";
my @patternMatchArray;
while (<FILE>) {
push @patternMatchArray, $_ if /$myPattern/;
}
close FILE;
Hope this helped.
CombatSquirrel.
Entropy is the tendency of everything going to hell.