perlquestion
Anonymous Monk
O dwellers of Perl, have I a mighty perplexing affair that causes me a grave despair. It is basically with regard to the different ways we read a file once it has been opened. I know that there's reading a file line wise or in bulk, that's via syntax similar to <c>$line = <FH></c> or <c>@lines = <FH></c> respectively, and that the second case might warrant <c>undef</c>ing the variable $/ and then maybe splitting or doing array manipulation.
<p>What I am confused about is when in a loop I have something like <c>while(<FH>){...}</c>, is this any different than <c>$line=<FH></c> or are these granularly the same?</p>
<p>
To delete a file we use <c>unlink</c> and to close a file handle we use <c>close</c> and then we have <c>undef</c> which can also close a filehandle for us, my heart tells me that using <c>undef</c> this way is somewhat frowned upon or sinful, is that justified?
</p>
<p>While I feel I can handle files to some degree, I still find it difficult to summarize my knowledge with respect to the issue presented in this post, could ye wise ones steer forth to the podium and clarify these and thus thou shalt assist a needy knowledge-seeker.</p>
14