tags:

views:

347

answers:

5

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?

+2  A: 

I like the idea of Yada Yada, although time will tell if it is actually useful.

David Dorward
+4  A: 

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:

DVK
BTW, above picks are just my opinion. YMMV obviously :)
DVK
+5  A: 

while( 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.

Brad Gilbert
Congratulations!
Michael Carman
+5  A: 

This is my favourite feature by far:

use 5.012; # enables 'use strict' implicitly!
tsee
Thanks for the typo fix, Alexandr!
tsee
+2  A: 

There's some subtle but non-trivial improvements that will make Portable (flash drive) Perl distributions work better (or at all).

Perl also now has support for 64-bit on Windows with GCC, so Strawberry Perl 64-bit should come out soon.