Skip to content

Commit

Permalink
fix EOL processing
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqs committed Apr 19, 2022
1 parent 85eac60 commit fb7cdf3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions t/002-main.t
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@ sub readFile
{
my $f = shift ;

my @strings ;
open (F, "<$f")
or die "Cannot open $f: $!\n" ;

{
open (F, "<$f")
or die "Cannot open $f: $!\n" ;
binmode F;
@strings = <F> ;
close F ;
}
binmode F;
local $/;
my $data = <F> ;

# normalise EOL
$data =~ s/\r\n/\n/g;
close F ;

return @strings if wantarray ;
return join "", @strings ;
return $data;
}

0 comments on commit fb7cdf3

Please sign in to comment.