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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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


New User

Oct 18, 2011, 4:20 AM

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

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

use blabla ;

I am not sure where is the copy of 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?



Oct 18, 2011, 9:56 AM

Post #2 of 3 (3876 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)

New User

Oct 18, 2011, 10:27 AM

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

I found my answer - that is %INC - at

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


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

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