sub new { my $class = shift; my $sftp = bless { }, $class; $sftp->{host} = shift; $sftp->init(@_); } sub init { my $sftp = shift; my %param = @_; $sftp->{debug} = delete $param{debug}; $param{ssh_args} ||= []; $sftp->{_msg_id} = 0; my $ssh = Net::SSH::Perl->new($sftp->{host}, protocol => 2, debug => $sftp->{debug}, @{ $param{ssh_args} }); ... #### $sftp = Net::SFTP::->new($host, user => $username, password => $password, ssh_args => [ options => [ "StrickHostKeyChecking no" ] ] );