my @pids; for my $cmd (@cmds) { push @pids, $ssh->spawn(@$cmd); }