First I'd like to slap you with a customary RTFM, since the first page of the IO::InnerFile documentation states: "Note that FILEHANDLE must be able to seek() and tell(), in addition to whatever other methods you may desire for reading it." ;)
broquaint offered a solution that manipulated IO::Handle's @ISA. Whilst this works I wouldn't recommend it. Making IO::Handle provide IO::Seekable's methods would perhaps break another class that inherits IO::Handle and uses AUTOLOAD. Or maybe a class inherits something more than IO::Handle, and that other class implements IO::Seekable's methods.
I suggest making an own class that inherits both IO::Handle and IO::Seekable,
and then bless the filehandle into that, before passing it to &IO::Innerfile::new: bless $fh => MyHandle::; Now $fh implements what's needed to make IO::InnerFile function. Hope I've helped,{ package MyHandle; use base qw/ IO::Handle IO::Seekable /; }
In reply to Re: IO::InnerFile inheriting from IO::Handle?
by ihb
in thread IO::InnerFile inheriting from IO::Handle?
by BazB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |