There is a script that I am trying to troubleshoot that sometimes waits to write a line previously printed to the filehandle until the filehandle is closed.
At the end of the script it does this:
print FILE (scalar localtime)." ## Exit\n";
close FILE;
which results in a line previously previously printed to be written to the file after the Exit line. However, if I do this:
print FILE (scalar localtime)." ## Exit\n";
exit();
close FILE;
everything is fine. It's probably not a good idea to exit before the close, so I'm looking for another way to get the same results.
many thanks great holders of wisdom.