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