for my $machine ( @machines ) { async { open my $out, '>', "$machine.dat" or die $!; for my $cmd ( @commands ) { my $content = get "$machine/$cmd"; print $out $content; } close $out; }->detach; }