my @lines; { local $/; open my $fh, '<', $datei or die $!; my $content = <$fh>; @lines = split /\r?\n/, $content; } print "Line: $_\n" for @lines;