It includes advice as simple as using the three-argument form of open and lexical file handlesI'm sure you know this, but some readers may get the wrong impression. Neither three-argument open() nor lexical file handles dates from the last 2-3 years. Three arg open dates from 5.6 (released last millennium, when Perl6 was still a term referring to Chips aborted Topaz project).
"Lexical file handles" (or rather, references to file handles stored in a lexical variable) have been available for much longer. I don't have anything older than 5.005_04 at the moment, but I think they worked since 5.000. What was new in 5.6 (and that's what made them popular) was the autovivification of them. The following code uses "lexical file handles" and runs on pre-5.6 code:
use strict; local *FILE; my $fh = \*FILE; open $fh, "</etc/passwd" or die; while (<$fh>) { print; } __END__
In reply to Re^2: Summary of Perl in the past 2-3 years
by JavaFan
in thread Summary of Perl in the past 2-3 years
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |