in reply to find module name from the module archive
Since a properly created package has a MANIFEST file, you could extract just that, then use Module::Locate to test if the modules in the package have been installed.
Disclaimer: Not tested. YMMV
#!perl use strict; use warnings; use Archive::Tar; use Module::Locate qw/ locate /; my $tar = Archive::Tar->new; $tar->read('origin.tgz', COMPRESS_GZIP, {filter => 'MANIFEST'}); my @files = split /[\r\n]/, $tar->get_content( 'MANIFEST' ); my @modfiles = grep s|lib/||, @files; my @modules = map s|/|::|, @modfiles; for (@modules) { my $p = locate($_); if ($p) { print "Found '$_' at '$p'\n"; } else { print "Not installed: '$_'\n"; } }
|
|---|