CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
get lib full path

 



yorams70
New User

Oct 18, 2011, 4:20 AM

Post #1 of 3 (2900 views)
get lib full path Can't Post

Hello.
I have a Perl script that uses a certain lib that someone in my work wrote.

Code
use blabla ;


I am not sure where is the copy of blabla.pm that this script uses.

I want to print the full path of the lib that is used.
Is there a variable that stores the full path?

Thanks.


wickedxter
User

Oct 18, 2011, 9:56 AM

Post #2 of 3 (2890 views)
Re: [yorams70] get lib full path [In reply to] Can't Post

the directories perl uses to search for modules is keept in the %INC array. You can print that and take a look their. You also might be able to search from the base folder for the module.

if no help their might have to search the whole drive for it b/c if the module uses the ' lib ' module it can be anywhere outside the normal lib and site folders.

edit: opps sry wrong type should of been % rather then @ ....


(This post was edited by wickedxter on Oct 18, 2011, 12:29 PM)


yorams70
New User

Oct 18, 2011, 10:27 AM

Post #3 of 3 (2888 views)
Re: [wickedxter] get lib full path [In reply to] Can't Post

Thanks,
I found my answer - that is %INC - at
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#The__INC_hash


Code
  % cd /tmp 
% perl -e 'BEGIN{unshift @INC, "/tmp"} use test; \
print map {"$_ => $INC{$_}\n"} keys %INC'

test.pm => /tmp/test.pm


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives