Highlights of Perl 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.