In association with heise online

Perl 5, Version 10

Perl 5 version 10.0 (traditionally, this has been called Perl version 5.10.0, but I, and some of the people I interviewed for this article, think there's a case for breaking with that - Perl 5 has seen substantial changes in its point releases) was released in December 2007 and version 10.1 is expected soon (10.0 was described as a 'testing' release). There's lots of new stuff in version 10. For instance, it introduced a native switch statement (called given/when, it's an example of fruitful theft from Perl 6 - though you might like to wait for 10.1 to get something that more nearly matches the current Perl 6 spec) alongside other Perl 6 borrowings like the // (defined or) operator and say() (a convenience version of 'print' that automatically appends a new line. Not every change is huge, sometimes it's all about convenience). The regular expression engine has also been significantly improved, gaining new features as well as, arguably, a larger population of developers who understand how it works under the hood. (It used to be said that there were 3 +/- 5 people in the world who understood how the perl regular expression engine worked.)

Perl 5 development has also moved over to git for source control (replacing the proprietary Perforce and an svn mirror). It's too early to say if this change will have a large effect on the development process, but a repository containing 21 years of changes makes for a substantial initial 'git clone' step.

Positive though these developments in the language itself are, the real meat of modern Perl is the Comprehensive Perl Archive Network (CPAN), a vast repository of good, bad and downright ugly code, for almost every eventuality. If you're setting out on a project in Perl, the first step is to search CPAN (at http://search.cpan.org) to see if there's a ready to use solution.

On most systems, the process of installing a module and its dependencies has been a matter of issuing the command 'cpan DBI DBD::Sqlite' say, then sitting back while the tool fetches the DBI and DBD::Sqlite module and their dependencies, compiles anything that needs compiling and installs everything in an appropriate place. If you're on a system that has a readily accessible compiler, it's all pretty much automatic.

The fly in the ointment here has been the Windows platform. Getting access to a Windows compiler isn't quite as easy as it is on other platforms and that's tended to mean that Windows Perl hasn't been seen as a 'proper' Perl. Sure you can make it work, but there's a lot of ground work before you can compile even the simplest XS module (XS modules are those which are partially implemented in C).

Which is where the 'Perl-on-a-Stick' project saves the day. In 2008, Adam Kennedy was funded by the Perl Foundation to make his Strawberry Perl Windows distribution relocatable and he succeeded spectacularly. This means that there's now a Windows distribution of Perl which you can copy to a 128M memory stick and which gives you a fully relocatable distribution of Perl and the full tool-chain needed to install pretty much any module from CPAN. On top of this, Adam has managed to get Microsoft involved in providing a testing facility for a CPAN author to test their modules on various windows platforms as well as whatever platform they happen to develop on. Given the ongoing drive for quality on CPAN this is huge.

Next: "The New Perl Enlighenment"

Print Version | Permalink: http://h-online.com/-746527
  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit