in reply to how to parse large files

You're almost there with buildRegexp, but you can speedup it further by removing sub call:

sub build_regexp { my $expr = join '|', map { "(?:To|is)\:\S+\@$_" } @_; eval { $expr = qr/$expr/i }; die "aaa!! $@ !!!" if $@; $expr; }
(note that I'd suggest changing () grouping into (?:) grouping if you're not using $1). then, all you need is
my $writeFh = new FileHandle ">> myout.log"; my $is_subset = build_regexp(@allSubSets); while (<fh>) { next unless /$is_subset/; print $writeFh <$fh>; }

Replies are listed 'Best First'.
Re^2: how to parse large files
by dk (Chaplain) on Mar 29, 2007 at 13:06 UTC
    oh. print $writeFh $_; of course.