package your::Net:FTP; use strict; use warnings; # make your::Net::FTP inherit all the methods of Net::FTP use base qw( Net:FTP ); # now you're free to redefine/override what ever you want # our new method replacement sub new { # call the original Net::FTP new method my $ftp_obj = shift->SUPER::new(@_) or return 0; # add our custom code $ftp_obj->{my_data} = 'test'; return $ftp_obj; } # and method all our own sub my_function { my $ftp_obj = shift; # do some stuff }