for my $host (@hosts) { if (!$pm->start("cmd1 on $host")) { exec(@cmd1, $host); print(STDERR "cmd1 exec failed: $!\n"); _exit($!); } if (!$pm->start("cmd2 on $host")) { exec(@cmd2, $host); print(STDERR "cmd2 exec failed: $!\n"); _exit($!); } }