Perl Module Location: Difference between revisions
From Leo's Notes
This page was last edited on 1 September 2019, at 06:22.
initial page |
m Text replacement - "Category:Linux{{Navbox Linux}}" to "{{Navbox Linux}}Category:Linux" |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
To find a perl module's location, run | To find a perl module's location, run | ||
{{highlight|lang= | {{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= | {{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 | ||
| Line 20: | Line 20: | ||
[[Category:Code]] | [[Category:Code]] | ||
[[Category:Linux]] | {{Navbox Linux}}[[Category:Linux]] | ||
Latest revision as of 06:22, 1 September 2019
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