Newer Exporter for Older Perls

ferreira on 2007-12-10T11:49:38

Let's start by saying that Exporter is not an ideal module. It was conceived a long time ago, when some things (like programming practices) were different. But if you need a module with exporting capabilities and are not very demanding, Exporter is the module to use. As a bonus, it is there together with your installed perl.

Once we said this, this article is to announce that Exporter is now available at CPAN and now correctly indexed. This means that from within your CPAN shell, you may say:

cpan> install Exporter

and this omnipresent Perl module will be updated to the latest release.

Why is that important?

A lot of CPAN modules break unexpectedly because its authors used the Exporter feature

  use Exporter 'import';

which allows a module to get the Exporter's &import without needing to inherit from Exporter. However, this appeared only in Exporter 5.57 which was released with perl 5.8.3.

That means that every time a module, which did the assumption that this feature were always there with Exporter, was tested against a pre-5.8.3 perl, it choked.

Now these modules can correctly declare they need at least version 5.57 of Exporter and cpan will try to update this very important piece of your standard libraries, to the dismay of many conservative people (including some sysadmins) out there. (Disclaimer: but it will only update if you say so: explicitly or by the configurations you have set up.)

That's evolution coming: time to use new tools even with rusty perls. Maybe, in the next step, people start using newer perls as well. (Hail, 5.10!)