in reply to Inheritance confusion
This sounds like a case for composition and delegation instead of inheritance.
Create a Net::FTP object in your constructor, but don't inherit from Net::FTP. Add an AUTOLOAD that dispatches all appropriate calls to the object. Something like this untested code would work:
sub AUTOLOAD { our $AUTOLOAD; my $self = shift; my ($meth_name) = $AUTOLOAD =~ /::(\w+)$/; my $method = $self->{_ftp}->can( $meth_name ); return $self->{_ftp}->$method( @_ ) if $method; # handle error here }
|
|---|