$ perl /tmp/t.pl zeilenweise /tmp/t.pl # zeilenweise aus Dateihandle lesen while ( my $line = <$fh> ) { if ( index( $line, $pattern ) >= 0 ) { print $line, <$fh>; } } close $fh; $