my @lines; open my $fh,'<',$file or die $!; while(<$fh>){ if(/START/ .. /ENDE/){ push(@lines,$_); } } close $fh; print $_ for @lines;