13

I have a bunch of scripts that I wrote at times when I did not realize how use v1.2.3; can be useful. So some of them may be using features from later versions of perl, some of them may be OK with, say, perl 5.8.

Now I would like to get that into some order and add proper uses where there is need for them, just to be able to sleep better. :-)

How should I do that? Is there any tool that could help me make an educated guess?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
Alois Mahdal
  • 10,763
  • 7
  • 51
  • 69

2 Answers2

14

Perl::MinimumVersion

Find a minimum required version of perl for Perl code

toolic
  • 57,801
  • 17
  • 75
  • 117
  • I hear there's a lot it doesn't check for. The docs even imply this. But at least it's a starting point. – ikegami Feb 29 '12 at 22:34
8

The most reliable way is 1) to write a decent test suite, then 2) to run your tests using each version of Perl.

You've surely already done the first part (!), and the second part is actually pretty easy to do using perlbrew.

ikegami
  • 367,544
  • 15
  • 269
  • 518
  • Thais accept was really a tough one to decide: actually your answer seems more like _The Right Thing_ to me. Finally I based the choice on the word *guess* in the question and on the fact that `perlbrew` is actually [not supported](https://github.com/gugod/App-perlbrew/issues/31) for Win32. – Alois Mahdal Mar 02 '12 at 13:03
  • 1
    @Alois Mahdal, It's actually even easier on Windows since you can just download different builds already compiled for you by ActiveState. – ikegami Mar 02 '12 at 19:17