in reply to migrate cpan from AIX to Red Hat

find /usr/lib/perl5 -name \*.pm | xargs yum whatprovides will not work because the prefix will be different. But it is a good idea. dists can be named differently to modules.

I thought of using CPAN or a simple script like instmodsh (from ExtUtils::Installed) to get the list of your modules, and then mangle the names to find the rpm's.

perldoc ExtUtils::Installed

Replies are listed 'Best First'.
Re^2: migrate cpan from AIX to Red Hat
by sazo (Novice) on Jul 31, 2013 at 08:36 UTC
    I found the option to consider the modules in a given directory my $installed = ExtUtils::Installed->new(extra_libs=>["/my/lib/path"]); But I still don't understand why is there a huge difference in the number of modules found by this method and by using find *.pm? There are more than 10x more .pm files as modules found by this method. Can multiple .pm files belong to a module?
      I found it out: it seem a module can contain several .pm files.
Re^2: migrate cpan from AIX to Red Hat
by sazo (Novice) on Jul 31, 2013 at 08:08 UTC
    I have been working on a solutions that is based on the find *.pm and yum whatprovides, but it needs a lot of parsing of the yum output in order to create a list of rpms and repositories that need to be installed on the new RH machines. Thanks for the tip with the Extutils:Installed. Unfortunatelly, listing the installed modules using instmodsh only shows a tiny fraction of all the installed modules, probably because they are installed outside the default directories.