package Custom::FTP; use Net::FTP; @ISA = ('Net::FTP'); #proxy module for Net::FTP - allows us to change hostname etc for testing purposes sub new { my $class = shift; my $self = {}; bless $self, $class; my $remote_host = shift; #check to see where we are if ( _not_prod() ) { $remote_host = 'our.test.host'; } $self->{parent} = Net::FTP->new($remote_host, @_); return $self; } sub login { my $self = shift; my @opts = @_; if ( _not_prod() ) { $opts[0] = 'testuser'; $opts[1] = 'testpassword'; } my $parent = $self->{parent}; return $parent->login(@opts); } sub _not_prod { #more code }