Which way is recommended ?by matrixmadhan (Beadle)
|on Nov 21, 2008 at 18:12 UTC||Need Help??|
matrixmadhan has asked for the
wisdom of the Perl Monks concerning the following question:
This question should be a breeze to you all.
To open a file, read the contents, print them and close the file - I used to use the following piece of code
But I have seen somewhere ( from net, not sure where ) that the below version is better.
1) Using $lfh instead of FILE directly
2) Using a variable $line as $line = <$lfh>, instead of directly using $_
Could you please explain the difference in usage and the better form of using it?