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

后端 未结 9 660
小蘑菇
小蘑菇 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:10

    If need to find which modules are actually used by your script you can use perl debuggers M command:

    [ivan@server ~]$ perl -d your_script.pl
    ...
    
    Debugged program terminated.  Use q to quit or R to restart,
      use o inhibit_exit to avoid stopping after program termination,
      h q, h R or h o to get additional info.
    
    DB M
    'AutoLoader.pm' => '5.60 from /usr/lib/perl5/5.8.8/AutoLoader.pm'
    'Carp.pm' => '1.04 from /usr/lib/perl5/5.8.8/Carp.pm'
    ...
    

    This will help in case when you have modules with same names but in different folder.

提交回复
热议问题