<<Previous Post Next Post >>

Highlights of Perl 5.14

Jan Dubois, May 17, 2011
ActivePerl 5.14

We've just released ActivePerl 5.14.0!

The exhaustive list of new features and improvements can be found in the perldelta document, but here's a look at a few of the notable changes.

Unicode improvements

The "unicode_strings" feature is now fully functional, affecting all string operations, including regular expression matches.

The new /a, /u, and /l regular expression modifiers let you explicitly use ASCII, Unicode, or locale semantics for character classes. For example:

$str =~ /(\d+)/a;

This expression will only match the ASCII digits '0' to '9' and not any other Unicode characters that happen to be in the "Digit" category, regardless of the internal encoding of $str.

Exception Handling

Exceptions are now more reliable. Any exception thrown inside an eval block will be visible in $@ outside the block. Previously this exception could have been clobbered by a local($@) inside the block, or by destructors running during the stack unwinding.

Non-destructive substitution

The s/// substitution operator has a new non-destructive /r option to work on a copy of the string. The operator returns this copy (after performing the substitution) instead of the number of substitutions performed. The original value is never modified.

For example:

(my $copy = $orig) =~ s/cat/dog/;

...becomes easier to read as:

my $copy = $orig =~ s/cat/dog/r;

This is even more useful with the map() operation:

my @copy = map { (my $copy = $_) =~ s/cat/dog/; $copy } @orig;

This can now be written simply as:

my @copy = map { s/cat/dog/r } @orig;

End of Perl 5.10 support

The "official" Perl 5 community support for Perl 5.10 ends with the release of Perl 5.14.0. However, ActiveState will continue to support 5.8 and 5.10 for Business Edition and Enterprise Edition customers along with the newer releases.

Starting with the 5.14.1 release (about one month from now) ActivePerl 5.8 installers will no longer be available as free Community Edition downloads. As with ActivePerl 5.6, these will only be available with the commercial editions. The PPM repositories for ActivePerl 5.8 will be available for a while longer for Community Edition users.

PPM packages for 5.14

The ActiveState PPM repositories are currently being updated with CPAN modules compiled for 5.14. Check the PPM Index pages in the coming days as more and more packages become available.

Trackback URL for this post:

http://www.activestate.com/trackback/3074
Category: perl
About the Author: RSS
Jan Dubois is a senior Perl developer who maintains Win32::OLE and is the technical lead for the Perl Dev Kit. Before joining ActiveState, Jan created innovative solutions for customers in the German banking and insurance industry. He holds a Masters Degree in Physics (Diplom-Physiker) from the University of Hamburg.
SHARE THIS:

Comments

6 comments for Highlights of Perl 5.14

Is there a binary mod_perl available yet for ActivePerl 5.14? PPM would be best, even if I had to manually move a file into the Apache tree. I hate to have to go back to an older version just so I can use mod_perl.

No, not that I'm aware of. The latest build I could find was from University of Winnipeg for 5.12:

http://cpan.uwinnipeg.ca/PPMPackages/12xx/

Trouchelle shows a build failure, but no working build:

http://trouchelle.com/perl/ppmrepview.pl?l=mod_perl&v=14

Looks like nobody builds this successfully for Windows:

http://matrix.cpantesters.org/?dist=mod_perl%202.0.5

Is there a repository with modperl for perl 5.14 available ?

Not that I know. Note that PPM can't completely install modperl anyways, as parts of it (mod_perl.so) needs to be installed into the Apache tree and not into Perl.

Something bad happened to your regex in your blog engine. You're missing the backslash before the d+ (what you have now will match zero or more lowercase letter 'd')

Thanks! Fixed.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.