my $logSem : shared; ... { lock $logSem; print LOGFH ...; }