Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What I am confused about is when in a loop I have something like while(<FH>){...}, is this any different than $line=<FH> or are these granularly the same?
To delete a file we use unlink and to close a file handle we use close and then we have undef which can also close a filehandle for us, my heart tells me that using undef this way is somewhat frowned upon or sinful, is that justified?
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: File Reading and Closing confusion
by zentara (Archbishop) on Aug 08, 2010 at 14:03 UTC | |
Re: File Reading and Closing confusion
by shmem (Chancellor) on Aug 08, 2010 at 14:17 UTC | |
by repellent (Priest) on Aug 08, 2010 at 23:31 UTC | |
by shmem (Chancellor) on Aug 09, 2010 at 00:23 UTC | |
by repellent (Priest) on Aug 09, 2010 at 03:49 UTC | |
by shmem (Chancellor) on Aug 09, 2010 at 09:30 UTC | |
| |
Re: File Reading and Closing confusion
by cdarke (Prior) on Aug 08, 2010 at 16:10 UTC | |
Re: File Reading and Closing confusion
by ikegami (Patriarch) on Aug 09, 2010 at 00:17 UTC |