necessary. Sure the file handle will be closed implicitly when it goes out of scope but then you can't check the result. It's just as import to check the return value of close() as it is to check the return value of open, if not more so... particularly when a file is being written to. That, said lexically scoped file-handles are always a good idea.