In the first example, files are opened & closed as iteration progresses. Is it correct to assume that in the second case files are collectively closed at the end of the script? Is the Perl interpreter smart enough to close files in the same manner as the first example?