How to Trace the Perl Modules used in Web Appication?

anujbionfo
anujbionfo used Ask the Experts™
on
Hi

How can I trace the Perl modules used by the web application?

Thanks
Anuj
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:

You can use the freely downloadable TraceUse module.

try these commands from a shell window:

perl -MCPAN -e 'install Devel::TraceUse'
perl -d:TraceUse your_program.pl

where you_program.pl is the perl web application you want to examine.


-Sampath Weerasinghe
http://www.linkedin.com/in/sampathweerasinghe

Commented:
What exactly you wish to do???

Tracing perl module means??
  • Do you want to know that particular module is being called by which perl script or package
  • Which subroutine is being called of that particular module
  • What is the url of that page which calls particular module
Can you please elaborate little more so that we can work on it efficiently

Author

Commented:
Hi
I need to know the module is being called by which perl script or package and subroutine is being called of that particular module .

Thanks
Anuj

Commented:
use caller() method.
Pseudo-code:
       my  @callerfun = caller(1);
       my  $refer = $ENV{REQUEST_URI};
        open  FH,">>C:\query.txt";
         print FH  sprintf( "\"%s\"  # \"%s\"  # \"%s\" #   \"%s\"  \n",$callerfun[0],$callerfun[1] ,$callerfun[3],$refer);    
         close(FH);

$callerfun[0] will have package name which called the particular method
$callerfun[1] will contain file name from where it is being called
$callerfun[3] will contain the name of subroutine which called particular query
$refer is having url of the page.

I hope this will help you. If you need further assistance or fully working code. Let us know.

Suhas .Senior QA Manager

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial