Check out Module::CoreList to see whether a module was part of the core perl release for any given version e.g
BEGIN {
for(@your_list_of_modules) {
die "$0: $_ is unavailable in perl$]\n"
unless exists $Module::CoreList::version{$]}{$_};
}
}
| [reply] [d/l] |
perldoc perlmodlib will show you the core modules for your currently installed version of perl | [reply] |
| [reply] |
I'd be more interested in a log of what modules I've installed. Perhaps one exists that I haven't found. Sometimes those PPM installations load dependancies faster than I can read them as they scroll by.
| [reply] |
foreach my $path (@INC) {
my @modules = glob "$path/*.pm";
foreach my $module (@modules) {
print "You have module $module installed\n";
}
}
A more elegant solution would involve using File::Find to recursively search the directories, and create the proper names for modules. (For instance, the Net::SMTP module would be called SMTP.pm under the directory Net)
Want to support the EFF and FSF by buying cool stuff? Click here.
| [reply] [d/l] [select] |
That doesn't differentiate between which modules were installed as part of the Perl core, and which were installed after the fact. The OP is interested in knowing which modules were bundled with Perl. We already got a pretty good answer; perlmodlib has a mostly up-to-date listing of Perl's core modules. My counter-question was how to determine which modules I've installed that didn't ship with Perl as a core module.
I guess, to your point, I could use File::Find to resurse Perl's @INC paths, keeping track of the names of all modules found, and then compare that list to the one provided in perlmodlib.
| [reply] |
perldoc perllocal gives you a list of the modules installed to the site lib directory. I'm not sure how/whether this works with PPM.
hth
-- I'm Not Just Another Perl Hacker
| [reply] |
perllocal is not updated on module deinstall.
| [reply] [d/l] |
I use a simple rule of thumb: if I can find it under lib, it's a core module, but if under site/lib, where all additional modules get installed by default, it's not...
But the latter doesn't mean it didn't come with perl — and this is actually your main concern. ActivePerl, likely the distibution for which installing extra modules is seen as problematic (though not actually for technical reasons... ;-)), comes with quite a few extra installed modules, such as XML::Parser, HTML::Parser, and LWP. You surely wouldn't want to miss out on those for no good reason.
So, the safest is still to check if a standard install comes with them.
Even so, if a module is worth it, I'd still use it even if it didn't come with perl.
If anything, it's possible to bundle the additional modules, or the whole install, as a PAR archive. | [reply] |