in reply to Re: Re: module location
in thread module location

Well, for DBI, this tells you all three of those things:

perl -MDBI=9999

But good luck on a more general solution, seems like there have been some good suggestions for you.

Replies are listed 'Best First'.
Re: Re: Re: Re: module location
by hmerrill (Friar) on Nov 07, 2003 at 17:28 UTC
    Part of that doesn't work, at least on my system. Here's what I get:
    [hmerrill@merrill bin]$ perl -MDBI=9999 DBI version 9999 required--this is only version 1.32 at /usr/lib/perl5/5.8.0/Exporter/Heavy.pm line 121. BEGIN failed--compilation aborted.
    It does print the version of DBI(1.32), but notice that the path name refers to Exporter::Heavy, and not DBI.

      It's a bit long as one-liners go, but it does the job and could probably be golfed.

      P:\test>perl -le"BEGIN{eval qq[use $ARGV[0]]} print ${$ARGV[0].'::VERS +ION'}; $ARGV[0]=~s[::][/]g; print $INC{$ARGV[0].'.pm'}" File::Find 1.04 d:/Perl/lib/File/Find.pm

      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      Hooray!
      Wanted!