in reply to Re: Mac vs. PC line breaks
in thread Mac vs. PC line breaks

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";

Replies are listed 'Best First'.
Re^3: Mac vs. PC line breaks
by Joost (Canon) on Aug 05, 2005 at 18:19 UTC