The time printed in files overlaps.use strict; my $pid = fork(); if($pid == 0) { `perl write.pl f1.txt`; exit(0); } my $pid = fork(); if($pid == 0) { `perl write.pl f2.txt`; exit(0); } exit(0); ### where write.pl is: use strict; my $file = $ARGV[0]; open OF, ">$file" or die "cannot open file $file\n"; for(1..10) {print OF time()."\n"; sleep 1} exit(0);
In reply to Re^2: Running parallel processes without communication
by vit
in thread Running parallel processes without communication
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |