while ( my $line = <$filehandle> ) { if ( $line =~ m{START} .. $line =~ m{ENDE} } { # tu was mit Zeilen von START bis ENDE (Regex Matching) } }