there is no functional difference between the lexical file handles in your example and the traditional global file handles
Please see this recent discussion about lexical vs. bareword filehandles. In particular, open(N, "<", $filename); chomp (my $numbers = <M>); only gives warnings, while open(my $N, "<", $filename); chomp (my $numbers = <$M>); is of course a fatal error under strict. Also, bareword filehandles clash with package names.
In reply to Re^3: Summing numbers in a file
by haukex
in thread Summing numbers in a file
by pvfki
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |