use Net::OpenSSH; my $ssh = Net::OpenSSH->new($hostname, user => $username, password => $password); $ssh->error and die "unable to connect: " . $ssh->error; $ssh->rsync_put(@local_files, $remote_dir);