How can I tell if a Perl module is core or part of the standard install?

前端 未结 7 707
猫巷女王i
猫巷女王i 2020-12-13 06:04

How can I check if a Perl module is part of the core - i.e. it is part of the standard installation?

I\'m looking for:

  • a command-line command:
相关标签:
7条回答
  • 2020-12-13 06:32
    • From the command-line:

      Let's say that you want to know whether module Tie::Hash is installed.
      To find out, execute the following from the command line:

      perl -MTie::Hash -e 1
      

      If you don't get any output from the above command then the module is installed; if you get an error, it's not installed.

    • For making this check from within the script you can make use of Module::Load::Conditional.

    0 讨论(0)
提交回复
热议问题