in reply to IO::InnerFile inheriting from IO::Handle?

As far as I can see, IO::InnerFile isn't inheriting from IO::Handle in any way.
Well... IO::Handle is the default class for an autovivified filehandle. That likely will have something to do with it.
  • Comment on Re: IO::InnerFile inheriting from IO::Handle?

Replies are listed 'Best First'.
Re: Re: IO::InnerFile inheriting from IO::Handle?
by BazB (Priest) on Feb 03, 2003 at 23:59 UTC
    Even if the default class is IO::Handle, IO::InnerFile has it's own tell method:
    sub tell { return tied(${$_[0]})->{CRPOS}; }

    Any idea why it's not being called?

    Cheers.

    BazB

    If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
    That way everyone learns.

      Any idea why it's not being called?
      Because it's calling the tell() method on an IO::Handle object, not a IO::InnerFile object, and the reason it's croaking is that IO::Handle doesn't have a tell method. A solution is adding IO::Seekable to IO::Handle's inheritance
      BEGIN { use IO::Seekable; push @IO::Handle::ISA, 'IO::Seekable'; } use strict; use warnings; use Data::Dumper; use IO::InnerFile; open(my $fh, $0); my $inner = IO::InnerFile->new($fh, '100', '50'); while (<$inner>) { print; } close($fh); __output__ Data::Dumper; use IO::InnerFile; open(my $fh, $0

      HTH

      _________
      broquaint