How to guess minimum perl version a particular script is written for?

257 Views Asked by At

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?

2

There are 2 best solutions below

1
toolic On BEST ANSWER

Perl::MinimumVersion

Find a minimum required version of perl for Perl code

2
ikegami On

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.