Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.