digdoug has asked for the wisdom of the Perl Monks concerning the following question:
This code:
predictably produces this:#!usr/bin/perl use Parallel::ForkManager; my $MAX_PROCESSES=10; $pm = new Parallel::ForkManager($MAX_PROCESSES); $pm->run_on_finish( sub { my ($pid, $exit_code, $ident, $signal, $core) = @_; print "$pid $exit_code $ident $signal $core\n"; } ); foreach ( a .. f ) { my $pid = $pm->start($_) and next; my $exit_code = 40; $pm->finish($exit_code); }
change:20151 40 a 0 0 20152 40 b 0 0 20153 40 c 0 0 20154 40 d 0 0 20155 40 e 0 0
tomy $exit_code = 40;
and you get:my $exit_code = 'forty';
or:20963 0 a 0 0 20965 0 c 0 0 20966 0 d 0 0 20967 0 e 0 0
and you get:my $exit_code = \'forty';
Just wondering.22040 192 a 0 0 22041 192 b 0 0 22042 192 c 0 0 22043 192 d 0 0 22044 192 e 0 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing string/refs to run_on_finish with Parallel::ForkManager
by Fletch (Bishop) on Apr 18, 2007 at 17:45 UTC | |
|
Re: passing string/refs to run_on_finish with Parallel::ForkManager
by derby (Abbot) on Apr 18, 2007 at 18:29 UTC | |
|
Re: passing string/refs to run_on_finish with Parallel::ForkManager
by Moron (Curate) on Apr 18, 2007 at 19:50 UTC |