so the code looks likesub some_subroutine { my ($string) = @_; my ($output1, $output2, $output3); if ( $string eq $some_other_string_a ) { $output1 = 1350; $output2 = 9234; $output3 = 8889; } if ( $string eq $some_other_string_b ) { $output1 = 1345; $output2 = 2234; $output3 = 3689; } if ( $string eq $some_other_string_c ) { $output1 = 2256; $output2 = 3370; $output3 = 1340; } @retval = ($output1,$output2,$output3); }
Or do you have an simple example that really works?#!/usr/bin/perl use Parallel::ForkManager; @all_strings=('110110101000101111', '110010101001011101', '110110111001001110', '110011101001011100', '111010101001011100'); my $pm = new Parallel::ForkManager(4); foreach $string (@all_strings) { my $pid = $pm->start and next; ($ouput1, $output2, $output3 ) = some_subroutine($string); $pm->finish; } $pm->wait_all_children;
In reply to Re^2: Parallel::ForkManager is time consuming...takes too long
by esolkc
in thread Parallel::ForkManager is time consuming...takes too long
by esolkc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |