I solved the problem quite simply. First, I read the fscking manual a third time and I noticed that while I was autoflushing the buffer on STDOUT, I wasn't flushing the buffer on the filehandle.
I fixed this by using autoflush on the filehandle:
open (LOGFILE, ">tempLog.$time" ) || die "Cannot open tempLog for writ
+ing: $!\n";
autoflush LOGFILE 1;
print LOGFILE "Socket server started on port $port at ", localtime, "\
+n";
If you make something idiot-proof, eventually someone will make a better idiot.
I am that better idiot. |