I would suggest that using the lexical variable for the filehandle is a good idea even in small one-off scripts. A very wise person once told me
There is nothing more permanent than temporary code.
Quite often quick-and-dirty scripts grow and become critical. Also, using the lexical filehandles is a good habit to cultivate.
On the other hand, I often prefer to use $_ rather than an explicit variable in small loops. For me that's more of a style issue than anything else.
In reply to Re^3: Which way is recommended ?
by gwadej
in thread Which way is recommended ?
by matrixmadhan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |