in reply to File locking with semaphores

I don't see where the semaphore is set to any actual file. It seems like two different logger objects logging to the same log file would have two different semaphores and so defeat the purpose of locking anything. Wouldn't it be simpler to just lock the log file itself? (Though I can see the need for a common semaphore file if logs are cycled and you want log times to be continuous between cycled log files). Also, I don't get the need for:
my $FH=*{$$self{FILEHANDLE}};
And another way to get rid of the open warning is with:
$self->{FILEHANDLE}->open(">>$logfile") or ...
Update: Ah, just noticed the package $SEM variable. Nevermind on the first issue...(though you are assuming that all logging processes are in the same current directory opening the same semaphore file, maybe there ought to be a semaphore directory argument, or default to the same directory as the logfile, or ???).