open(DOUT, "+>>$log_file");
seek (DOUT, 0,0);

が安定じゃね?