Perl - Debugging

perl

Debugging and Profiling mod_perl Applications
DTrace and Perl (DTrace originated on Solaris platform, ported to Mac, and possibly Linux). There are a couple of videos available on YouTube.com
http://plosquare.blogspot.com/2009/04/debugging-modperl-applications-with.html
http://epic-ide.org/tracker/mod-perl-debugging.php
https://topic.alibabacloud.com/a/how-to-use-eclipse-to-debug-font-colorredperlfont-applications_1_59_31913962.html
https://sourceforge.net/p/e-p-i-c/discussion/258688/thread/14e24479/
https://wiki.eprints.org/w/EclipseEpicPerlDebug
https://stackoverflow.com/questions/16867719/how-to-debug-java-and-perl-code-in-eclipse-in-same-debug-session
http://blog.timmattison.com/archives/2012/03/14/how-to-install-perl-debugging-in-eclipse-on-debian-ubuntu/
https://perl.apache.org/docs/1.0/guide/debug.html
https://www.perlmonks.org/?node_id=562785

https://perldoc.perl.org/perldebug
https://www.thegeekstuff.com/2010/05/perl-debugger/
https://stackoverflow.com/questions/4945876/how-can-i-debug-a-perl-script
https://stackoverflow.com/questions/27847319/run-a-perl-script-in-debugging-mode
https://stackoverflow.com/questions/3852395/is-there-a-way-to-turn-on-tracing-in-perl-equivalent-to-bash-x
https://stackoverflow.com/questions/8923266/how-can-i-run-through-a-perl-program-step-by-step
https://stackoverflow.com/questions/53342512/how-to-debug-a-perl-program-starting-from-a-specific-line
https://www.cs.cmu.edu/afs/cs/user/rgs/mosaic/pl-debug.html
https://perlmaven.com/debugging-perl-scripts
https://users.cs.cf.ac.uk/Dave.Marshall/PERL/node152.html
https://www.davetill.com/perlbook/ch21.htm
https://www.perl.com/article/160/2015/3/13/Quickly-Debug-your-Perl-code-at-the-command-line/
https://sites.harding.edu/gfoust/reference/perldb.html

How can we debug a Perl file?

Perl comes with its own debugger:

perl -D test.pl
perl -d file.pl
perl -d:ptkdb buggy.pl buggy.pl (See Devel::ptkdb)
valgrind --leak-check=yes --trace-children=yes perl whatever.pl

What is EPIC?

EPIC is a plugin for Eclipse, capable of debugging CGI application. To debug CGI application, EPIC acts as a proxy between the web server and the client. This enables it to control and monitor the execution of the script, even though technically the script is being accessed through the web server. You'll need to put a copy the scripts onto the server (you can use the Export function of Eclipse). You will also need to configure the name of a 'startup' file to be used when debugging. This file will be returned when the web server is first accessed and it should contain a link to the script or the form that uses the script. EPIC comes with a built-in web browser. EPIC also has a regular expression debugger. tutorial

Can we use Komodo to debug mod_perl?

Komodo from ActiveState can debug mod_perl.

Can we debug mod_perl by inserting 'PerlRequire …./perl5db.pl' into httpd.conf?

Possibly. I haven't tried this yet.

How can we profile a Perl program?

To profile you Perl program, just type:

perl -d:DProf myprogram.pl

When the script terminates the profiler will dump the profile information to a file called tmon.out. A tool like dprofpp can be used to intepret the information in the profile.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License