Help for this page
sub worker { my( $Q ) = shift: ... ## Perform output/cleanup } }
## in the main thread: my $outputMutex : shared; ... lock $outputMutex; print OUTFILE ... }