如何知道最初在机器上安装特定Perl的模块? [英] How can I tell what modules were originally provided with the specific Perl installation on a machine?

查看:169
本文介绍了如何知道最初在机器上安装特定Perl的模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何知道最初在机器上安装特定Perl的模块?

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

(这是不是
如何知道Perl模块是核心还是标准安装的一部分?
(如何知道Perl模块是核心还是标准安装的一部分?)
- 实际上是一个分拆的问题)

(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.

我希望这可以与任何 Perl版本一起使用。

I would like this to work with any Perl version.

我想可以这样做:


  • 使用Perl程序本身的脚本/机器上的命令 有安装。所以对于这个,我将依赖于安装,以便在安装之前,先下载一个包,然后才能以某种形式记录它原来的内容。

  • 。请问它有什么模块。

  • using a script within a Perl program itself/command on the machine that has the installation. So for this I would be relying upon the installation to have a record in some form as to what it has originally.
  • on the downloaded package before I do the install. Ask it what modules it has.

我想这样做的原因是:


  • 我想知道在使用Perl安装的机器上编写软件时,我可以期望什么模块,以及需要添加哪些模块,不是默认的/ li>
  • 如果我保留原始的安装程序映像/包或知道如何再次在线获得确切的事情,那么我有一个重复的一致Perl安装几台机器,知道什么模块将存在以及什么模块不会。

  • 我的Perl软件将具有良好的定义部署过程,因为它很容易定义软件所需的内容

  • 由于我的组织中的政策,我可能无法轻松更新/升级Perl版本(就这样,我不想在这方面进行讨论)。这样的政策是有道理的,因为总是有风险升级到可以超过利益的新软件。因此,开发人员需要知道他们可以预期的可用性。

我提出这个问题的原因是因为对于任何Perl版本,似乎没有一种自动的方式来找出整体标准安装,定义您可以预期在机器上的默认安装中可以看到哪些模块 - 请参阅问题:
如何知道Perl模块是核心还是标准安装的一部分?
(如何知道Perl模块是核心还是标准的一部分?安装?)

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?" )

Perl版本不能依赖于告诉您什么模块是否存在。当然可能有在线的文档告诉你。但是,在我下载/安装的版本中,我需要一种自动化的方法。即使是在不同Linux / Unix发行版上的Perl版本也可以不同。

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.

推荐答案

一般来说,你不能。如果您接受并从不同的角度来解决问题,那么您的沮丧就会减少很多。 Module :: CoreList 提供了应该的列表在所有安装中都包含在最低限度内,但是供应商不需要遵守,大多数发行版包括许多不是核心部分的模块。禁止建立自己的数据库,其中包含哪个版本的每个发行版 - 一项艰巨的任务 - 没有太多希望。请注意,即使对于发行版本的模块,安装的版本可能会有所不同。

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:


  1. 如果您在开发阶段知道您的目标(例如,特定的
    版本的ActivePerl),您可以根据这些决定。

  2. 对于一般情况,将应用程序部署为模块并指定
    依赖关系。例如使用 Module :: Build ,并在
    <$ c $中列出先决条件c>需要Build.pl脚本的部分。 cpan shell可以自动跟踪并解决
    依赖关系。

  3. 如果您想要回避问题,请使用 PAR Par :: Packer
    创建自包含的部署包。

  1. If you know your target at development time (e.g. a specific version of ActivePerl) you can make decisions based on that.
  2. For the general case deploy your application like a module and specify dependencies. e.g. use Module::Build and list prerequisites in the requires section of the Build.pl script. The cpan shell can follow and resolve dependencies automatically.
  3. If you want to sidestep the issue entirely use PAR and Par::Packer to create self-contained deployment bundles.

这篇关于如何知道最初在机器上安装特定Perl的模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆