in reply to parsing large files for something

As AnonMonk so delicately put it, Just do it. The size of the file will be inconsequential if you're just doing the processing line by line.
my $buffer; while (<$fh>) { $buffer = $_ if /$regex1/; print $buffer if /$regex2/; }