Module::Info seems to do what you need. Create an
object using the constructor in one of the three ways
below and then call inc_dir() method.
use Module::Info;
my $mod =
Module::Info->new_from_file('Some/Module.pm');
my $mod =
Module::Info->new_from_module('Some::Module');
my $mod =
Module::Info->new_from_loaded('Some::Module');
my $dir = $module->inc_dir();
HTH,
Stefan
--- Greg London <[EMAIL PROTECTED]> wrote:
> Thanks to everyone who gave feedback on my
> Parse::Native module. I'm modifying it to
> roll in everyone's suggestions.
>
> On a totally unrelatd note:
>
> is there a quick and dirty way to find out where the
> heck
> perl is finding a module being use'ed is located?
>
> This seems to come up often enough that I thought
> I'd ask and see if there's a quick fix.
>
> If I have a perl script that says
>
> use MyModule;
>
> I want to know the path to MyModule.pm.
>
> I can manually go through all the @INC and PERLLIB
> directories, but I was hoping perl would have a
> quick
> one liner that I could do that would look something
> like this:
>
> perl -e "use MyModule; print $magic_var;"
>
> is there something that does this?
> Greg
>
> _______________________________________________
> Boston-pm mailing list
> [EMAIL PROTECTED]
> http://mail.pm.org/mailman/listinfo/boston-pm
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm