On Wed, Apr 28, 2004 at 05:36:51PM -0400, Greg London wrote:
> 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?
If you just want to know the path to a module on the command line, use
perldoc:
perldoc -l MyModule
If you actually want to know the path to a module within your script, use
%INC:
use MyModule;
print $INC{'MyModule.pm'}, "\n";
Ronald
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm