From: "Thomas J." Message-ID: <1175178049.657421.112810@n59g2000hsh.googlegroups.com> Date: 29 Mar 2007 07:20:49 -0700 cadetg@googlemail.com schrieb: > > my %lookingFor; > # keys => different name of one subset > # values => array of one subset > > my $fh = new FileHandle "< largeLogFile.log"; > while (<$fh>) { > foreach my $subset (keys %lookingFor) { > foreach my $item (@{$subset}) { > if (<$fh> =~ m/$item/) { > my $writeFh = new FileHandle ">> myout.log"; print $writeFh < > $fh>; > } > } > } > Your code will "copy" the following lines from "lagreLogFile.log" after successful patternmatch into "myout.log" This may be time-consuming... ...and possible not what you expected? (use $_ instead of <$fh> in your "if" and in your "print") REs may lead to "endless matching". Please show some samples. study may/may_not help before patternmatching. (perldoc -f study) Thomas