ActiveBlog

Highlights of Perl 5.14
by Jan Dubois

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.

Subscribe to ActiveState Blogs by Email

Share this post:

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.

Comments

8 comments for Highlights of Perl 5.14
Permalink

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')

Permalink

Thanks! Fixed.

Permalink

Is there a repository with modperl for perl 5.14 available ?

Permalink

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.

Permalink

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.

Permalink

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

Permalink

At least it works with Perl 5.12.
Install Apache2.22.2
Install Perl 5.12
ppm install http://cpan.uwinnipeg.ca/PPMPackages/12xx/mod_perl.ppd

-- this dialog will be seen----------------------------
-- Begin of ppm-messages ------------------------------
c:\Perl12\bin>ppm install http://cpan.uwinnipeg.ca/PPMPackages/12xx/mod_perl.ppd

Syncing site PPM database with .packlists...done
Downloading mod_perl-2.000004...done
Unpacking mod_perl-2.000004...done
Generating HTML for mod_perl-2.000004...done
Updating files in site area...done
Downloading mod_perl-2.000004 install script...done
Running mod_perl-2.000004 install script...Set up gcc environment - 4.6.2

The Apache2 module mod_perl.so is needed to complete the installation,
and should be placed in your Apache2 modules directory. I will
now fetch and install this for you.

Fetching http://cpan.uwinnipeg.ca/PPMPackages/12xx/x86/mod_perl.so ... done!
Where should mod_perl.so be placed? [D:/Apache2.2/modules] c:/Apache2.22.2/modules
mod_perl.so has been successfully installed to c:/Apache2.22.2/modules.
To enable mod_perl, put in the directives
LoadFile "C:/Path/to/Perl/bin/perl510.dll"
LoadModule perl_module modules/mod_perl.so
in httpd.conf. For more information, visit
http://perl.apache.org/
and especially see
http://perl.apache.org/docs/2.0/rename.html

done
419 files installed
-- Begin of ppm-messages ------------------------------

After that mod_perl is incorporated into Apache.
Well done Randy Kobes, well done ActiveState!

Permalink

Hi. We plan to upgrade to Perl 5.14.0 or 5.16.0 and are in need of a free Perl IDE for debugging purposes. Can you recommend and IDE or at least refer me to one that will work with Perl 5.14.0 or 5.16.0? Thanks very much.