Typo: "\015\12" should be "\015\012"
But why not replace
my $newline; for my $test ("\015\012","\015","\012") { # Default to unix. $newline = $test; last if /$test/; }
with
# Default to unix. my ($newline) = /(\015\012|\015|\012)/ ? $1 : "\012";
which simplies to
# Default to unix. my ($newline) = /(\015\012?)/ ? $1 : "\012";
In reply to Re^2: Mac vs. PC line breaks
by ikegami
in thread Mac vs. PC line breaks
by godzirra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |