DrWhy has asked for the wisdom of the Perl Monks concerning the following question:
use IO::All; use IO::File; open G, '<test.txt'; $h = IO::File->new_from_fd(fileno(*G{IO}), 'r'); $i = io($h); print $i->getline
The docs of IO::All seem to imply that this should work, but when I run this (Win XP, ActiveState Perl 5.8.8, IO:All v0.33), I get:
Can't call method "opened" on an undefined value at C:/perl/site/lib/I +O/All/File.pm line 78.
I've also tried variations without the IO::File intermediary, i.e., $i = io(*G{IO}), $i = io(\*G), $i = io->handle(*G), all to no avail.
Has anyone been down the path before and have a workable solution to this?
Update: This is now in RT.
Thanks,
--DrWhy
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I create an IO::All object from a pre-existing filehandle
by almut (Canon) on Jun 11, 2009 at 16:05 UTC | |
|
Re: How do I create an IO::All object from a pre-existing filehandle
by ikegami (Patriarch) on Jun 11, 2009 at 18:50 UTC | |
|
Re: How do I create an IO::All object from a pre-existing filehandle
by Anonymous Monk on Jun 11, 2009 at 00:39 UTC | |
by DrWhy (Chaplain) on Jun 11, 2009 at 00:56 UTC | |
by Anonymous Monk on Jun 11, 2009 at 01:07 UTC | |
by DrWhy (Chaplain) on Jun 11, 2009 at 01:16 UTC | |
by Anonymous Monk on Jun 11, 2009 at 03:17 UTC | |
|