in reply to process synchronize.... Please help me out
Where do you print $pid? You declare two variables $pid in two places:
$pm->run_on_finish( sub { my ($pid, $exit_code, $ident) = @_; $tmpFile +s[$ident] = undef; } );
Here, $pid is likely the PID of the child that just terminated.
my $pid = $pm->start($i) and next;
Here, $pid will always be 0 after the next statement. Maybe you want something like this:
my $pid = $pm->start($i); if ($pid) { print "Launched child $pid\n"; next; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: process synchronize.... Please help me out
by Anonymous Monk on Apr 22, 2009 at 04:39 UTC | |
by Corion (Patriarch) on Apr 22, 2009 at 05:15 UTC | |
by sandy1028 (Sexton) on Apr 22, 2009 at 05:32 UTC | |
by Corion (Patriarch) on Apr 22, 2009 at 07:00 UTC | |
by sandy1028 (Sexton) on Apr 22, 2009 at 07:26 UTC |