I would like to ask you which is more optimal for my code.
I have a script that takes, say maybe 15 mins or more to run... The results are placed into an output file. My question is, is it better to open the output file once, in the beginning and keep it open (I mean with the filehandle), , or open and close it whenever I have something to print into it?