in reply to Re^2: Odd behaviour of Parallel::ForkManager
in thread Odd behaviour of Parallel::ForkManager
If you expect interleaved output, you will need to disable output buffering and make your code much slower:
sub alpha { foreach my $i (900 .. 1900) { print 'A',"\t"; sleep rand(2); } } sub numeric { foreach my $j (1 .. 1000) { print $j,"\t"; sleep rand(2); } } # Make print() output unbuffered; $| = 1; LINKS: foreach my $linkarray (@links) { $pm->start and next LINKS; # do the fork ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |