in reply to Re^2: Which way is recommended ?
in thread Which way is recommended ?

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.

G. Wade