Subject: | IO::All 0.44 overloading issues |
Date: | Wed, 9 Nov 2011 13:00:38 +0200 |
To: | bug-IO-All [...] rt.cpan.org |
From: | Gabor Szabo <szabgab [...] gmail.com> |
slurp and all are not the same in list context:
my @data = io($0)->slurp; # reads each line in a separate element
my @data = io($0)->all; # reads all the lines in a single element
Which, as you explained, is the expected behavior but I think it is not
explained in the docs.
my $data < io $0; # works as expected but
my @data < io $0; # returns an empty list
I expected it to act as slurp does.
io($0) > my $data; # works as expected but
io($0) > my @data; # returns empty array
here too I expected a slup-like behavior.
my @data = qw(a b);
@data > io($0); # save 2 in the file so it works in scalar context
I expected it to save "ab" in the file but it saves "2".