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: Beginner:
How to find the file which is including the perl module?

 



naven8
Novice

Apr 6, 2012, 9:34 PM

Post #1 of 3 (896 views)
How to find the file which is including the perl module? Can't Post

If i am dealing with multiple files and used "use *MODULE*" in one of the file.
Then How can i find that file which is having "use *MODULE*"

what is the meaning of the following line in perl?

Code
 $::XYZ


Thanks in advance


(This post was edited by naven8 on Apr 7, 2012, 7:24 AM)


wickedxter
User

Apr 7, 2012, 12:24 PM

Post #2 of 3 (871 views)
Re: [naven8] How to find the file which is including the perl module? [In reply to] Can't Post

let me ask if im understanding the question your asking.... Your asking if theirs a way to check where the module is located that being called by the " use module " statement in your program? most if not all modules are in the folders ./lib/ or ./site/lib but if they are custom modules they will be hiding else where..

you can search the directories in the @INC for a locations. if the program is calling a custom module you can look for a " use lib " statement and it will point you to the modules hiding point


the code

Code
$::XYZ  #i think this is wrong, its missing who it belongs to... unless its shorthand for $main::XYZ 

$module::XYZ # this is accessing the internal variable of the module that's being used...



naven8
Novice

Apr 7, 2012, 10:31 PM

Post #3 of 3 (843 views)
Re: [wickedxter] How to find the file which is including the perl module? [In reply to] Can't Post

To find the actual module location i can directly use the %INC.
Looks like my question is not clear i will explain it with a example.


Code
 
file1.pm
# Only writing required portion
use Cwd;

file2.pm
# Some other content

file3.pl
use file1;
use file2;


Here i need the file which is having use Cwd. If there are multiple files involved then to find the file which is using "use Cwd" is difficult.

I hope the above one explain my question.
Thanks in advance.


(This post was edited by naven8 on Apr 9, 2012, 6:10 AM)

 
 


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

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