in reply to File copier

Using Net::OpenSSH::Parallel you can run all the operations in parallel. It is probably going to be much faster:
use Net::OpenSSH::Parallel; my $pssh = Net::OpenSSH::Parallel->new; my $machinelist; my $machinelistfilename = "./machinelist.txt"; open($machinelist, "<", $machinelistfilename) or die $!; while(<$machinelist>) { chomp; mkdir $_; -d $_ or die $!; $pssh->add_host($_, user => "username"); } $pssh->push('*', scp_get => { glob => 1 }, '/tmp/nmonout/*', "./%HOST% +/); $pssh->push('*', command => "find /tmp/nmonout/ -mtime +2 |xargs rm"); $pssh->run;