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

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 Grid Engine system. Sometimes, even run as other username.

I can use CPAN.pm to install packages for myself, but it is not so easy to install for other users without chmod 666 on folders.


perl -MTime::HiRes -e 'print $INC{"Time/HiRes.pm"}' or perldoc -l Time::HiRes


Mostly I use perldoc to get a location:

$ perldoc -l Module

You can also 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)
    [email protected]

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)
    [email protected]

I think maybe I need an XML option like svn.