I
it_says_BALLS_on_your forehead
is this dangerous? for instance, is there ever a danger of race
conditions/locking/etc if i have:
use strict; use warnings;
use Parallel::ForkManager;
my $pm = Parallel::ForkManager->new(10);
# assume @files contains 100 files that will be processed,
# and processing time could range from subseconds to hours
my $out = 'results.txt';
for my $file (@files) {
$pm->start and next;
# some code to process file
# blah blah blah
open( my $fh_out, '>', $out ) or die "can't open $out: $!\n";
print $fh_out "$file\n";
close $fh_out;
$pm->finish;
}
$pm->wait_all_children;
conditions/locking/etc if i have:
use strict; use warnings;
use Parallel::ForkManager;
my $pm = Parallel::ForkManager->new(10);
# assume @files contains 100 files that will be processed,
# and processing time could range from subseconds to hours
my $out = 'results.txt';
for my $file (@files) {
$pm->start and next;
# some code to process file
# blah blah blah
open( my $fh_out, '>', $out ) or die "can't open $out: $!\n";
print $fh_out "$file\n";
close $fh_out;
$pm->finish;
}
$pm->wait_all_children;