in reply to Which way is recommended ?
instead of directly using $_
The term "directly" is not quite correct here, because it suggests that $_ is used in any case.
$_ will not be set if you write while( my $line = <$lfh> ).
In my opinion, using $_ is not really elegant. It's a global variable and it will be visible to called subroutines even if you localize it. Well, in perl 5.10 you can avoid this my using my $_. But unlike with named variables, you won't get any errors from strict if you forget to my the variable.