#!/usr/bin/perl use strict; use warnings; use Net::OpenSSH::Parallel 0.12; use Net::OpenSSH::Parallel::Constants qw(OSSH_ON_ERROR_IGNORE); @ARGV == 3 or die <push($label, rsync_put => "$src/$file", "$dst/$file"); $pssh->push($label, sub => \&fetch_next); } } my $p = Net::OpenSSH::Parallel->new(on_error => \&on_error); $p->add_host("worker$_", $host) for 1..5; $p->all(sub => \&fetch_next); $p->run;