Perl
  Home arrow Perl arrow Page 6 - Perl Debuggers in Detail
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PERL

Perl Debuggers in Detail
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2008-07-31


    Table of Contents:
  • Perl Debuggers in Detail
  • perl5db.pl
  • Alternative Debuggers
  • Devel::ebug
  • Other Debuggers
  • Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Perl Debuggers in Detail - Summary
    ( Page 6 of 6 )

     

    I can debug my Perl program at almost any level I want, from inserting debugging code around that part I want to inspect, or tweaking it from the outside with an integrated development environment. I can even debug the program on a machine other than the one I run it on. I don’t have to stick with one approach, and might use many of them at the same time. If I’m not satisfied with the existing debuggers, I can even create my own and tailor it for my particular task.

    Further Reading

    Perl Debugged by Peter Scott and Ed Wright (Addison-Wesley) is one of the best books about actually programming with Perl. Not only do they show you how to effectively debug a Perl program, but they also show you how to not get yourself into some of the common traps that force you to debug a program. Sadly, this book appears to be out


    Figure 4-7.  Affrus shows me the values of package variables in the Debugging pane

    of print, but don’t let the $1.99 price for a used version on Amazon.com color your notion of its usefulness.

    Pro Perl Debugging (Apress) by Richard Foley tells you everything you need to know about the perl5db.pl debugger, which comes with Perl. If you like Perl’s default debugger, this book will tell you everything you want to know about it.

    My first ever piece of Perl writing was a little piece for The Perl Journal number 9 called “Die-ing on the Web.” It’s available at my personal web site: http://www.pair.com/ comdog/Articles/Die_and_the_Web.txt.

    I talk more about Hook::LexWrap in “Wrapping Subroutines” in the July 2005 issue of The Perl Journal. The article originally appeared in The Perl Journal and now appears in the “Lightweight Languages” section on Dr. Dobb’s Journal Online: http:// www.ddj.com/dept/lightlang/184416218.

    The Practice of Programming by Brian W. Kernighan and Rob Pike (Addison-Wesley) discusses their approach to debugging. Although this isn’t a Perl book, it really doesn’t need to be about any language. It’s practical advice for any sort of programming.  


     

    * Larry Wall says that Laziness, Impatience, and Hubris are the principal virtues of a programmer, but those only work if the programmer is creating the code. Everyone else in the software development life cycle needs Tact, Humility, and Low Blood Pressure.

    † In Chapter 10, I show how I do this with third-party modules, too: copy the source to a private directory I add to the front of @INC. I can edit that copy without worrying about breaking the original.

    ‡ I know I should wrap an eval around this, but I need an example where things go wrong. Even if I did wrap it in an eval, I still need to find the culprit passing the unexpected input.

    § It changes all of the calls, so if I’m using mod_perl I’ll end up changing it for every program since they share the same global variables. Oops.

    ‖ My __DIE__ handler can escape die’s further exception processing by using exit or another die, which won’t be special inside my handler. See perlvar’s discussion on %SIG for details.

    #And I really mean mess. These functions both call Carp::longmess, and once you see the output, you’ll agree.

    * This might mean that I have to install the Tk module too. Once installed, I also have to be able to display it in some sort of window manager. On my Powerbook, I use Apple’s X11 program (which is really XFree86
    to the rest of the world). Windows users might want to use something such as ReflectionX.

    † The run method to Devel::ebug::Console concatenates with an empty string everything in @ARGV, so calling this example without the quotes tries to run the program named add_numbers.pl56 with no arguments.

    ‡ Once you get everything installed, but sure that you copy the root/ directory from the Devel::ebug::HTTP distribution to the same directory as the Devel::ebug::HTTP modules. Find that directory with perldoc -l
    Devel::ebug::HTTP. The root/ directory has the files that Catalyst needs to make the web pages.

    § I can also guess the URL, since I know the name of the machine and can figure out which port it will use.

    ‖ The Eclipse Foundation (http://www.eclipse.org.

    #Eclipse Perl Integration (http://e-p-i-c.sourceforge.net).

    * Late Night Software (http://www.latenightsw.com).  



     
     
    >>> More Perl Articles          >>> More By O'Reilly Media
     

       

    PERL ARTICLES

    - More Perl Bits
    - Perl, Bit by Bit
    - Basic Charting with Perl
    - Using Getopt::Long: More Command Line Option...
    - Command Line Options in Perl: Using Getopt::...
    - Web Access with LWP
    - More Templating Tools for Perl
    - Site Layout with Perl Templating Tools
    - Build a Perl RSS Aggregator with Templating ...
    - Looping, Security, and Templating Tools
    - Perl: Bon Voyage Lists and Hashes
    - Templating Tools
    - Perl: Number Crunching
    - Perl Debuggers in Detail
    - Debugging Perl





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT