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 Answer 1

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
2
  • 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, 2015 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, 2015 at 19:46

You must log in to answer this question.

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