How to find the minimum perl version required for a module

When creating a perl module it is important that you state the minimum perl version needed to run the code.

The Perl::MinimumVersion module can check a single perl file and output the minimum version required. In order to check an entire directory structure we can use the following line of bash, once Perl::MinimumVersion has been installed.

find lib -iname *.pm | perl -MPerl::MinimumVersion -e 'while(<STDIN>){chomp; print Perl::MinimumVersion->new($_)->minimum_version() . "\t$_\n"};' | sort -r

This will list the minimum version for each of the perl packages found in decending order.

Last updated: 02/07/2014