How can I tell which modules were originally provided with a specific Perl installation on the machine?

How can I find out which modules were originally provided with a specific Perl installation on a machine?

(This is not a duplicate: How do I know if the Perl module is the main or part of the standard installation? ("How do I know if the Perl module is the main or part of the standard installation?") - this is actually a side question)

I am looking for what happened with the installation initially, which modules were provided as part of this installation, what was built-in. NOT what has been installed since.

I would like this to work with any version of Perl.

I want to be able to do this:

  • using a script inside the Perl program / command itself on the computer on which the installation is installed. Therefore, for this I will rely on the installation in order to have a record in one form or another regarding the fact that it was originally.
  • in the downloaded package before installation. Ask what modules he has.

The reasons I want to do this:

  • I want to know which modules I can expect by default when writing software to run on a machine with Perl installation and which modules I need to add that are not standard
  • If I save the source file / installer package or know how to get the exact information again on the Internet, then I have a repeated sequential installation of Perl for several machines, taking into account which modules will be present and which modules will not.
  • my Perl software will have a well-defined deployment procedure because it is easy to determine what exactly is required for the software.
  • Maybe I canโ€™t just upgrade or upgrade the version of Perl due to the policies in place in my organization (this is the way it is, I donโ€™t want it to be discussed on the side). Such a policy may be justified, since there is always a risk of switching to new software that may outweigh the benefits. Therefore, developers should know what they can expect.

The reason I ask this question is that for any version of Perl there is no automated way to determine a common standard installation that determines which modules you can expect when installing by default on your computer - see the question: How to find out is Is the Perl module a core or part of a standard installation? ("How do I know if a Perl module is a core or part of a standard installation?")

You cannot rely on a Perl version to tell you which modules are present or not. Of course, there may be online documentation that tells you. But I need an automated way to do this in the release that I download / install. Even the same version of Perl on different Linux / Unix distributions may be different.

+6
perl deployment perl-module
Jan 18 '10 at 11:11
source share
3 answers

In general, you canโ€™t. You will have less frustration if you accept it and approach the problem from a different angle. Module :: CoreList contains a list of what should be included in all installations as a minimum minimum, but vendors are not required to adhere to this and most distributions include many modules that are not part of the kernel. The ban on creating your own database of what was included in which version of each distribution is a difficult task - there is not much hope. Please note that even for modules shipped with the distribution kit, the installed version may vary.

I see several different ways to approach this:

  • If you know your goal during development (for example, a specific version of ActivePerl), you can make decisions based on this.
  • In general, deploy your application as a module and specify dependencies. for example, use Module :: Build and list the prerequisites in the requires section of the Build.pl script. The cpan shell can follow and resolve dependencies automatically.
  • If you want to work around the problem, use PAR and Par :: Packer before creating standalone deployment packages.
+6
Jan 18
source share

For Debian or Ubuntu you can use

 $ dpkg --listfiles perl | grep '\.pm$' 

For Redhat:

 $ rpm -ql perl | grep '\.pm$' 
+6
Jan 18 '10 at 16:27
source share

We are looking for what happened with the initial installation, which modules were provided as part of this installation, what was built-in. NOT what has been installed since.

Perhaps for non-core modules, you can parse perllocal.pod by separating the initial batch of modules installed with the Perl installation itself from later versions based on the date. You are looking for strings such as:

 =head2 Wed Apr 30 15:40:38 2008: C<Module> L<URI|URI> 

Thus, the first few are supposed to be the ones that were installed with Perl itself and should have the same date (although not at the same time, of course). Those installed with a difference of 24 hours or more will be what you are looking for.

Iโ€™m not sure about the main modules, because, in my opinion, the answers that you received in the previous question to which you are connected are satisfactory, but, of course, you did not think so. I probably missed something :)

Cheers, Offer

0
Jan 18 '10 at 14:12
source share



All Articles