1 2 3 4 5 6 7 8
{ local $/ = "\012"; open my $fh, "<", "file.csv" or die $!; while (my $line = <$fh>) { chomp $line; # linefeed entfernen ... } }
open(my $fh, "<:crlf", "dateiname") or die $!;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Some of this may be confusing. Here's a handy reference to the ASCII CR and LF characters.
You can print it out and stick it in your wallet.
LF eq \012 eq \x0A eq \cJ eq chr(10) eq ASCII 10
CR eq \015 eq \x0D eq \cM eq chr(13) eq ASCII 13
| Unix | DOS | Mac |
---------------------------
\n | LF | LF | CR |
\r | CR | CR | LF |
\n * | LF | CRLF | CR |
\r * | CR | CR | LF |
---------------------------
* text-mode STDIO