in reply to Is adding print lines the only way to go to find computational error in a scrpt?

The only way? Absolutely not. I know that adding print lines is the preferred method of debugging for some people, but in my mind an actual debugger is by far the best tool.

Advantages for print statements:

  1. Simple - don't need to learn anything new.
Advantages for a debugger:

  1. Powerful - stepping, (conditional) breakpoints, actions, watchpoints, etc.
  2. Versatile - examine any value -- or the result of any expression -- at any point.
  3. Informative - dump complicated data structures, view stack traces, etc.
When perl5.6.1 is released, it will include a tutorial on using the debugger, written by Richard Foley.

Editor's note: thanks to davorg and neophyte for the following information (combined into one answer for better reference):
If you have trouble using the built-in debugger (see perldoc perldebug), check out the tutorial Using the Perl Debugger on this site.

  • Comment on Re: Is adding print lines the only way to go to find computational error in a scrpt?