- or download this
my $newline;
for my $test ("\015\012","\015","\012") {
...
$newline = $test;
last if /$test/;
}
- or download this
# Default to unix.
my ($newline) = /(\015\012|\015|\012)/ ? $1 : "\012";
- or download this
# Default to unix.
my ($newline) = /(\015\012?)/ ? $1 : "\012";