didess has asked for the wisdom of the Perl Monks concerning the following question:

Hi all monks !

Is there any way to know which file has been found and loaded from @INC, after a "use" or "require" ?

For example, if I "use myPack;" I'd like to print "Package myPack was in file "....";

Thanks for your help !

Didess

Replies are listed 'Best First'.
Re: where are my packages found ?
by Anonymous Monk on Oct 05, 2011 at 11:15 UTC
      That's great ! Thank you
Re: where are my packages found ?
by zentara (Cardinal) on Oct 05, 2011 at 15:02 UTC
    For a quick locater, you can use perldoc's -l option:
    perldoc -l CGI
    gives
    /usr/lib/perl5/5.14.1/CGI.pm
    

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: where are my packages found ?
by Anonymous Monk on Oct 05, 2011 at 11:20 UTC