|The stupid question is the question not asked|
Re^4: Please Explain the Parallel::ForkManager Idiom my $pid = $pm->start and next;by Jim (Curate)
|on Feb 05, 2014 at 01:46 UTC||Need Help??|
Exactly! That's the code in the demo script in the Parallel::ForkManager documentation. It's the example I was running and studying earlier. The PIDs and exit codes are included in the code for didactic reasons.
You'll appreciate my similar demo script based on the same kids-in-line-at-the-pool theme.
(As I post this script here, I notice there are vestiges of the original script still in the callback subs; namely, $pid and $exit_code. I could remove them.)
UPDATE: And if I'm truly serious about not caring about the PIDs, I could do this instead:
ANOTHER UPDATE: More weirdness. This works fine…
…but this blows up with Use of uninitialized value $kid in concatenation (.) or string at Pool.pl line 27…
No variation of pop()-ing @_ in run_on_finish() works.
YET ANOTHER UPDATE: OK, this is documented in…ahem…the documentation.