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

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.

Replies are listed 'Best First'.
Re: Re: Re: IO::InnerFile inheriting from IO::Handle?
by broquaint (Abbot) on Feb 04, 2003 at 11:04 UTC
    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