According to module documentation on IO::File on CPAN undef $fh closes the file automatically. In contrast to Python, in Perl there is more than one way to do it. So both of your options are valid.
getlines comes from IO::Handle and is safe in list context according to its documentation.
In reply to Re: A Few Questions About IO::File
by hdb
in thread A Few Questions About IO::File
by rpetrelli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |