in reply to Abort if instance already running?

I used locks in these case

#Open a file open(SINGLECHECK,">.server1.pid") or $file->log("$0:Cannot open the lo +ck file $!\n"); #Lock the file in exclusive mode and non-blocking mode so that no two +same demon will run. flock(SINGLECHECK, LOCK_EX|LOCK_NB) or ($file->log("$0:server is Alrea +dy running\n") and exit(1));

Replies are listed 'Best First'.
Re^2: Abort if instance already running?
by JavaFan (Canon) on Jan 06, 2009 at 11:20 UTC
    I'm a bit baffled by the last line. It suggests that either the log method always return a true value, or that if the logging somehow fails, the program doesn't exit.