1

This is in relation to this question: Why doesn't Perl use latest version by default?

I'm aware that I can force it with use v5.14 from within a script, and that's what I'm currently doing, but I'd like to force the interpreter itself to use the latest version by default.

Whether or not this is a good idea is not what I'm asking.

1

You can use the pragma when running perl like this:

perl -Mv5.14 my_script.pl

To use all features of the actual perl installed, this should work:

perl -M"feature ':all'" my_script.pl
  • So what I would do is go into /usr/bin/perl and replace the perl executable with a shell script that prepends "-Mv5.14" then calls the perl executable? – felwithe Aug 3 '15 at 16:18
  • You could. I don't think it's a good idea though. The system perl command is used by many system programs and they might be confused if you changed it. – buff Aug 3 '15 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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