I remember quickly adopting given .. when
, say
, //
, and the smart matching operator when Perl 5.10 came around.
What do you consider the most useful fixes and features introduced with Perl 5.12.0?
I remember quickly adopting given .. when
, say
, //
, and the smart matching operator when Perl 5.10 came around.
What do you consider the most useful fixes and features introduced with Perl 5.12.0?
I like the idea of Yada Yada, although time will tell if it is actually useful.
Raw data:
Interesting:
Wonderful:
Not sure if any of the info is new, but perlperf - Perl Performance and Optimization Techniques was added to documentation!!!
Useful:
\N
regex escape...
(aka Yada Yada) operatorwhile( readdir $dir ){}
now works a lot more like while( readline $file ){}
.
perl -MO=Deparse -e'while( readline $f ){}'
while (defined($_ = <$f>)) {
();
}
<$f>
is the same as readline $f
This is how Perl versions prior to v5.11.2 have been handling while( readdir $dir ){}
perl-5.10 -MO=Deparse -e'while( readdir $d ){}'
while (readdir $d) {
();
}
It is worth noting that the above will fail to work correctly if there is a file, or directory with the name of 0
. Which doesn't matter that much since it doesn't do anything useful anyway.
In Perl version 5.11.2 there was a patch added that brought it more into line with the handling of while( readline $file ){...}
.
perl-5.12.0 -MO=Deparse -e'while( readdir $d ){}'
while (defined($_ = readdir $d)) {
();
}
I would like to note that I was the one who provided that patch. It was the first thing I have ever tried to fix in the Perl core. So it was also the first patch I wrote, that made it into Perl.
This is my favourite feature by far:
use 5.012; # enables 'use strict' implicitly!