in reply to Inheritance confusion

The problem arises because Perl's inheritance is based upon blessed hashes, but Net::FTP uses blessed GLOB's ( courtesy of IO::Socket::INET).

One way around this would be to use an AUTOLOAD sub to extract the Net::FTP glob from your hash and re-dispatch the missing method via that. Something like (untested):

sub AUTOLOAD { my $self = shift; my $super = $self->{parent}; ( my $method = $AUTOLOAD ) =~ s[.*::][]; return $super->$method( @_ ); }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^2: Inheritance confusion
by Thelonious (Scribe) on May 23, 2005 at 13:23 UTC
    The problem arises because Perl's inheritance is based upon blessed hashes...

    Perl can use all kinds of references as the underlying data structures for objects. You don't have to use hashrefs, it's just that they're the most common, since object data often wants to be stored according to name.

    You can see Regexp refs and SCALAR refs being used as objects, in TheDamian's excellent Object Oriented Perl.