4

When I try to use new perl features (like "say" instead of "print") the code fails until I put in the line "use 5.014;" and then everything runs.

My installed version of perl is 5.14.2, and it looks like the only binary I have installed, why aren't the new features being used by default?

Thanks!

1 Answer 1

4

New features in Perl are not enabled, by default, for backward compatibility reasons.

From perdoc.perl.org:

This is often useful if you need to check the current Perl version before using library modules that won't work with older versions of Perl. (We try not to do this more than we have to.)

Also, if the specified Perl version is greater than or equal to 5.9.5, use VERSION will also load the feature pragma and enable all features available in the requested version. See feature.

Similarly, if the specified Perl version is greater than or equal to 5.11.0, strictures are enabled lexically as with use strict (except that the strict.pm file is not actually loaded).

A newer version of Perl has not yet been approved/committed for 12.04, 12.10, or even 13.10. See the main Ubuntu page for Perl here. However, it does look like there is some activity with work moving forward with Perl 5.17.

You could install from source, but I would not recommend over riding the system Perl installation. Instead, I would recommend installing a sandboxed version using PerlBrew.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .