Subject: | Can be difficult to debug |
This simple case is easy to debug:
use Parallel::Simple qw(prun);
my @plist = ();
my %params;
push @plist, [ \&foo, \%params ];
push @plist, [ \&bar, \%params ];
prun(@plist) || warn Parallel::Simple::errplus();
sub foo {
print "hello\n";
}
sub bar {
die "world\n";
}
The output is:
hello
world
only 1 of 2 blocks completed successfully
0 => 0
1 => 65280
And it's obvious that the second thread has died. However it's not difficult to conceive a situation where the threads to be started aren't known until runtime and if you have say 5 or 6 (or more) of them you really don't know which block has died. Perhaps named code blocks does that, but the example in the manual doesn't document how to include parameters to the named functions so I don't know how to do that so I can't try that..