$ file dos.txt dos.txt: ASCII text, with CRLF line terminators $ cat dos.txt Dies ist ein DOS-formatierter Text mit "\r\n" als Umbruch. $ cat linebreak.pl #! /usr/bin/perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Useqq = 1; my $file = shift or die "no file given.\n"; open my $fh, '<', $file or die "$file: $!\n"; my $line = <$fh>; print "passt: ".Dumper($1) if $line =~ m{^(.*)$}; $ perl linebreak.pl dos.txt passt: $VAR1 = "Dies ist ein\r"; $