Subject: | Error "Couldn't open a pipe" when more input parameters are given |
A slightly modified version of the example:
use Parallel::Loops;
my $maxProcs = 5;
my $pl = Parallel::Loops->new($maxProcs);
my @parameters = ( 0 .. 2000 );
my %returnValues;
$pl->share( \%returnValues );
$pl->foreach( \@parameters, sub {
$returnValues{$_} = sqrt($_);
});
foreach (@parameters) {
printf "i: %d sqrt(i): %f\n", $_, $returnValues{$_};
}
Where the only difference is that the number of parameters is increased
to 2000, gives the error:
Can't locate Carp/Heavy.pm in @INC (@INC
contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-
multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64
/perl5/vendor_perl/5.8.8/x86_64-linux-thread-
multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/l
ib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .)
at /usr/lib/perl5/5.8.8/Carp.pm line 255, <GEN2033> line 2.
Couldn't open a pipe
at /usr/lib/perl5/site_perl/5.8.8/Parallel/Loops.pm line 409, <GEN2033>
line 2.
This is perl, v5.8.8 built for x86_64-linux-thread-multi
Linux dev1.localdomain 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:52:25
EST 2011 x86_64 x86_64 x86_64 GNU/Linux
cpan upgrade command has been used, so all modules should be
reasonably recent. Perl 5.8.8 comes with RedHat, not possible to
upgrade.