# be eol agnostic
for (@poddata) {
- if (/\x0D/) {
- if (/\x0D\x0A/) {
- @poddata = map { s/\x0D\x0A/\n/g;
+ if (/\r/) {
+ if (/\r\n/) {
+ @poddata = map { s/\r\n/\n/g;
/\n\n/ ?
map { "$_\n\n" } split /\n\n/ :
$_ } @poddata;
} else {
- @poddata = map { s/\x0D/\n/g;
+ @poddata = map { s/\r/\n/g;
/\n\n/ ?
map { "$_\n\n" } split /\n\n/ :
$_ } @poddata;
#!./perl -w
-BEGIN {
- if (ord("A") == 193) {
- print "1..0 \# Skip: EBCDIC\n";
- exit(0);
- }
-}
-
use Test::More tests => 3;
open(POD, ">$$.pod") or die "$$.pod: $!";
open(POD, "<$$.pod") or die "$$.pod: $!";
open(IN, ">$$.in") or die "$$.in: $!";
while (<POD>) {
- tr/\x0D\x0A//d;
- print IN $_, "\x0D";
+ s/[\r\n]+/\r/gs;
+ print IN $_;
}
close(POD);
close(IN);
open(POD, "<$$.pod") or die "$$.pod: $!";
open(IN, ">$$.in") or die "$$.in: $!";
while (<POD>) {
- tr/\x0D\x0A//d;
- print IN $_, "\x0A";
+ s/[\r\n]+/\n/gs;
+ print IN $_;
}
close(POD);
close(IN);
open(POD, "<$$.pod") or die "$$.pod: $!";
open(IN, ">$$.in") or die "$$.in: $!";
while (<POD>) {
- tr/\x0D\x0A//d;
- print IN $_, "\x0D\x0A";
+ s/[\r\n]+/\r\n/gs;
+ print IN $_;
}
close(POD);
close(IN);