use Net::SCP qw(scp); my ($host, $username) = ("example.com", "eric"); $scp = Net::SCP->new( { "host"=>$hostname, "user"=>$username } ); for my $file (@files) { $scp->put($file) or warn $scp->{errstr}; } #### use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->connect('example.com') or die ("SSH2 Connect Error: $!"); if ($ssh2->auth_keyboard('password')) { for my $file (@files) { scp_put($file); } }