Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
.nl is deprecated in favor of .nl-in and .nl-out
.nl-in is an Array instead of a string:

$ p6 -e'$*IN.nl-in.perl.say'
$["\n", "\x[d]\x[a]"]

but assigning a scalar to it still works
  • Loading branch information
H.Merijn Brand - Tux committed Nov 4, 2015
1 parent 1a195c7 commit 42b177e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/Text/CSV.pm
Expand Up @@ -1216,13 +1216,14 @@ class Text::CSV {

multi method getline (IO:D $io, Bool :$meta = $!keep_meta) {
my Bool $chomped = $io.chomp;
my Str $nl = $io.nl;
$!eol.defined and $io.nl = $!eol;
$io.nl-in.perl.say;
my $nl = $io.nl-in;
$!eol.defined and $io.nl-in = $!eol;
$io.chomp = False;
$!io = $io;
my Bool $status = self.parse ($io.get);
$!io = IO;
$io.nl = $nl;
$io.nl-in = $nl;
$io.chomp = $chomped;
$status ?? $meta ?? self.fields !! self.list !! ();
} # getline
Expand Down Expand Up @@ -1253,8 +1254,8 @@ class Text::CSV {
Bool :$meta = $!keep_meta,
Bool :$hr = False) {
my Bool $chomped = $io.chomp;
my Str $nl = $io.nl;
$!eol.defined and $io.nl = $!eol;
my $nl = $io.nl-in;
$!eol.defined and $io.nl-in = $!eol;
$io.chomp = False;
$!io = $io;
$!record_number = 0;
Expand Down Expand Up @@ -1286,7 +1287,7 @@ class Text::CSV {
}

$!io = IO;
$io.nl = $nl;
$io.nl-in = $nl;
$io.chomp = $chomped;
@lines;
}
Expand Down Expand Up @@ -1331,8 +1332,8 @@ class Text::CSV {
}

my Bool $chomped = $io.chomp;
my Str $nl = $io.nl;
$!eol.defined and $io.nl = $!eol;
my $nl = $io.nl-in;
$!eol.defined and $io.nl-in = $!eol;
$io.chomp = False;
$!io = $io;
$!record_number = 0;
Expand All @@ -1357,7 +1358,7 @@ class Text::CSV {
}

$!io = IO;
$io.nl = $nl;
$io.nl-in = $nl;
$io.chomp = $chomped;
@lines;
}
Expand Down

0 comments on commit 42b177e

Please sign in to comment.