in reply to Re: Cleaning up filehandles and directoryhandles
in thread Cleaning up filehandles and directoryhandles

So don't use it. close the filehandle unconditionally.

Fair enough. I was trying to find a correct way to do things (in admist what seems to be a few mistakes). It doesn't exactly feel right that there is a method for checking if a file is open, but not a directory, and that it's good form to just close on everything, even if it isn't actually open.

And finally, it's very poor design for openFile's arguments to be in the reverse order of open's. Seeing that erodes my trust in the module, to say the least.

A fair call. The reversed order of openFile's arguments was done to match the order of argument's to FileHandle->new(). Thanks for the advice and I'll take a 'bigger picture' approach and match up openFile() to open().

  • Comment on Re^2: Cleaning up filehandles and directoryhandles