Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 022010
 

How to find a Perl Module's Path

Answer:

For example, we want to know where the module JSON and related modules exist in the local file system, we can try:

# perl -MJSON -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'

attributes.pm => /usr/share/perl/5.10/attributes.pm
XSLoader.pm => /usr/local/lib/perl/5.10.0/XSLoader.pm
warnings/register.pm => /usr/share/perl/5.10/warnings/register.pm
Carp.pm => /usr/share/perl/5.10/Carp.pm
Exporter/Heavy.pm => /usr/share/perl/5.10/Exporter/Heavy.pm
common/sense.pm => /usr/local/share/perl/5.10.0/common/sense.pm
vars.pm => /usr/share/perl/5.10/vars.pm
Exporter.pm => /usr/share/perl/5.10/Exporter.pm
strict.pm => /usr/share/perl/5.10/strict.pm
constant.pm => /usr/local/share/perl/5.10.0/constant.pm
warnings.pm => /usr/share/perl/5.10/warnings.pm
JSON/XS.pm => /usr/local/lib/perl/5.10.0/JSON/XS.pm
overload.pm => /usr/share/perl/5.10/overload.pm
base.pm => /usr/share/perl/5.10/base.pm
JSON.pm => /usr/local/share/perl/5.10.0/JSON.pm

  One Response to “How to find a Perl Module’s Path”

  1. Thanks a bunch. This was extremely helpful!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>