in reply to Inheritance confusion
Hope this helps.package My::FTP; use base 'Net::FTP'; sub new { # my($class,$host,%args) = @_; my $self = Net::FTP::new(@_) or die $@; ${*$self}{_custom_data} = 'CUSTOM DATA'; return $self; } sub custom { my $self = shift; return ${*$self}{_custom_data},"\n"; } package main; my $ftp = My::FTP->new(shift); $ftp->login(shift,shift) or die $ftp->message; print $ftp->pwd,$/; print $ftp->custom,$/; print ref $ftp,$/; __END__ / CUSTOM DATA My::FTP
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inheritance confusion
by GoCool (Scribe) on May 25, 2005 at 16:35 UTC |