Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

$s < io() doesn't work if $s is a ref #13

Open
aixtal opened this Issue Feb 16, 2013 · 2 comments

Comments

Projects
None yet
3 participants

aixtal commented Feb 16, 2013

Is this the intended behavior?

file1.txt:

cats

file2.txt:

dogs

test.pl:

#!/usr/bin/env perl
use 5.10.0;

use IO::All;

my $s;

$s < io('file1.txt');
say $s;
# --- 'cats' : ok

$s = [];

$s < io('file2.txt');
say $s; 
# --- ARRAY(0x7fcff40b79c0)
#     should output 'dogs' ?
Owner

ingydotnet commented Feb 18, 2013

I would possibly expect the array to contain the file lines, but this isn't happening.

I'll leave this open for the next time overloading is overhauled.

Collaborator

shlomif commented Oct 23, 2014

Hi @ingydotnet !

See: https://github.com/shlomif/io-all-pm/tree/issue13--overload-to-aref for a fix to this problem as you note. It contains several commits of tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment