use Net::OpenSSH::Parallel; my $pssh = Net::OpenSSH::Parallel->new(); $pssh->add_host($_) for @hosts; $pssh->push('*', scp_put => '/local/file/path', '/remote/file/path'); $pssh->push('*', command => 'gurummm', '/remote/file/path', '/tmp/output'); $pssh->push($special_host, command => 'prumprum', '/tmp/output'); $pssh->push('*', scp_get => '/tmp/output', 'logs/%HOST%/output'); $pssh->run;