perl -M'Data::Dumper' -M'
This will dump all the modules loaded out to screen for you. You can of course pipe this into grep to look for the specific module or modules you want. You will then get the path.
Observe:
c0malod@Takeshi:/Tools$ perl -M'Data::Dumper' -M'Time::HiRes' -e 'print Dumper(\%INC)'
$VAR1 = {
'warnings/register.pm' => '/usr/share/perl/5.10/warnings/register.pm',
'bytes.pm' => '/usr/share/perl/5.10/bytes.pm',
'XSLoader.pm' => '/usr/lib/perl/5.10/XSLoader.pm',
'Carp.pm' => '/usr/share/perl/5.10/Carp.pm',
'Exporter/Heavy.pm' => '/usr/share/perl/5.10/Exporter/Heavy.pm',
'vars.pm' => '/usr/share/perl/5.10/vars.pm',
'strict.pm' => '/usr/share/perl/5.10/strict.pm',
'Time/HiRes.pm' => '/usr/lib/perl/5.10/Time/HiRes.pm',
'Exporter.pm' => '/usr/share/perl/5.10/Exporter.pm',
'warnings.pm' => '/usr/share/perl/5.10/warnings.pm',
'AutoLoader.pm' => '/usr/share/perl/5.10/AutoLoader.pm',
'overload.pm' => '/usr/share/perl/5.10/overload.pm',
'Config.pm' => '/usr/lib/perl/5.10/Config.pm',
'DynaLoader.pm' => '/usr/lib/perl/5.10/DynaLoader.pm',
'Data/Dumper.pm' => '/usr/local/lib/perl/5.10.1/Data/Dumper.pm'
};
OR:
c0malod@Takeshi:/Tools$ perl -M'Data::Dumper' -M'Time::HiRes' -e 'print Dumper(\%INC)' | grep 'HiRes'
'Time/HiRes.pm' => '/usr/lib/perl/5.10/Time/HiRes.pm',
Simple little trick, but it works wonders. Cheers.
No comments:
Post a Comment