How can I tell what modules were originally provided with the specific Perl installation on a machine?
(This is not a duplicate of: How can I tell if a Perl module is core or part of the standard install? ( "How can I tell if a Perl module is core or part of the standard install?" ) - it is in fact a spin-off question from it )
I am looking for what came with the installation originally, what modules were provided as part of that installation, what was built-in. NOT what has been installed since then.
I would like this to work with any Perl version.
I want to be able to do this:
The reasons why I want to do this is:
The reason why I ask this question is because, for any Perl version, there appears not to be an automated way of finding out the overall standard installation defining what modules you can expect to be present in your default installation on your machine - see question: How can I tell if a Perl module is core or part of the standard install? ( "How can I tell if a Perl module is core or part of the standard install?" )
The Perl versions cannot be relied upon to tell you what modules are present or not. Sure, there might be documentation online that tells you. But I need an automated way of doing this on the release I download/install. Even the same Perl version on different Linux/Unix distributions can be different.
In general you can't. You'll have a lot less frustration if you accept that and approach the problem from a different angle. Module::CoreList provides a list of what should be included in all installations as a bare minimum but vendors aren't required to adhere to that and most distributions include many modules that aren't part of the core. Barring building your own database of what was included in which version of each distribution -- a daunting task -- there's not much hope. Note that even for modules that came with a distribution the installed version might be different.
I can see a few different ways to approach this:
requires
section of the Build.pl script. The cpan shell can follow and resolve
dependencies automatically.For Debian or Ubuntu, you can use
$ dpkg --listfiles perl | grep '\.pm$'
For Redhat:
$ rpm -ql perl | grep '\.pm$'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With