Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

look which and from where modules were included

by svad (Pilgrim)
on May 07, 2002 at 14:48 UTC ( #164663=snippet: print w/replies, xml ) Need Help??
Description: I've just re-invented a wheel and discovered a way to say which modules uses given one, and from which location they come.
Quite simple and usefull (for me at least).
for Win32:
perl -Mvars -we "print join qq/\n/,map {qq/$_=>$INC{$_}/} sort keys %I
+NC"
for other systems (including Cygwin):
perl -Mvars -we 'print join qq/\n/,map {qq/$_=>$INC{$_}/} sort keys %I
+NC'
Sample output will be
Carp.pm=>D:/perl561/lib/Carp.pm
Exporter.pm=>D:/perl561/lib/Exporter.pm
strict.pm=>D:/perl561/lib/strict.pm
vars.pm=>D:/perl561/lib/vars.pm
warnings.pm=>D:/perl561/lib/warnings.pm
warnings/register.pm=>D:/perl561/lib/warnings/register.pm
If other module needed, specify, for example, other -M option
Replies are listed 'Best First'.
Re: look which and from where modules were included
by svad (Pilgrim) on May 07, 2002 at 14:52 UTC
    ... and yes, it will be even shorter with -l option to shorten print statement...
    perl -Mvars -lwe "print for map {qq/$_=>$INC{$_}/} sort keys %INC"

      svad++

      This has just solved a little problem of mine finding where some troublesome modules where coming from on one system but not another, thanks. PerlMonks is the bees knees.

      Cheers,
      R.

      Pereant, qui ante nos nostra dixerunt!
Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://164663]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2018-09-26 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (205 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!