in reply to open FH, "|foo" under modperl2
When I want to log something myself, I usually open the file for append (>>) which allows you to not bother with locking.