How can I find out where a Perl module is installed?

后端 未结 9 651
小蘑菇
小蘑菇 2021-01-30 10:30

How do get the path of a installed Perl module by name, e.g. Time::HiRes?

I want this just because I have to run my perl script on different nodes of a SGE

9条回答
  •  野的像风
    2021-01-30 11:00

    You can get module details with the cpan tool that comes with Perl:

    $ cpan -D Time::HiRes
    Time::HiRes
    -------------------------------------------------------------------------
        High resolution time, sleep, and alarm
        J/JH/JHI/Time-HiRes-1.9719.tar.gz
        /usr/local/perls/perl-5.10.0/lib/5.10.0/darwin-2level/Time/HiRes.pm
        Installed: 1.9711
        CPAN:      1.9719  Not up to date
        Andrew Main (Zefram) (ZEFRAM)
        zefram@fysh.org
    

    It even works on modules that you haven't installed:

    $ cpan -D Win32::Process
    Win32::Process
    -------------------------------------------------------------------------
        Interface to Win32 Process functions
        J/JD/JDB/Win32-Process-0.14.tar.gz
        Installed: 
        CPAN:      0.14  Not up to date
        Jan Dubois (JDB)
        jand@activestate.com
    

    I think maybe I need an XML option like svn.

提交回复
热议问题