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); } }