Perl Module Location: Difference between revisions

From Leo's Notes
This page was last edited on 24 February 2017, at 04:21.
initial page
 
m Text replacement - "{{highlight|lang=bash" to "{{highlight|lang=terminal"
Line 1: Line 1:
To find a perl module's location, run
To find a perl module's location, run


{{highlight|lang=bash|code=
{{highlight|lang=terminal|code=
perl -M$ModuleName -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'
perl -M$ModuleName -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'
}}
}}
Line 8: Line 8:


Eg:
Eg:
{{highlight|lang=bash|code=
{{highlight|lang=terminal|code=
# perl -Mlocal::lib -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'
# perl -Mlocal::lib -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'
warnings.pm => /usr/share/perl5/warnings.pm
warnings.pm => /usr/share/perl5/warnings.pm

Revision as of 04:21, 24 February 2017

To find a perl module's location, run

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

Replace $ModuleName with the perl module name. This is case sensitive.

Eg:

# perl -Mlocal::lib -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'
warnings.pm => /usr/share/perl5/warnings.pm
local/lib.pm => /usr/local/share/perl5/local/lib.pm
strict.pm => /usr/share/perl5/strict.pm
Config.pm => /usr/lib64/perl5/Config.pm

See Also