Listing perl code

Using the perl debugger to produce a code listing. l usage l [min+incr|min-max|line|subname|$var] List code within the currently loaded file, in “windowSize” chunks. Note you can always get back to the current code position with the “.” command (below). See options for more information about “windowSize” Sometimes the default “windowSize” view of your code just … Read more

Pro Perl Debugging

Pro Perl Debugging steps in to help resolve the dilemma of application testing and debugging—one of the biggest time commitments in a programmers daily routine. What this book will do is rescue you from substandard application testing practices. The book commences with several chapters that overview the debuggers basic features, then covers common debugging scenarios. … Read more

The Dump-Value Command: C

The Dump-Value Command: C for the perl debugger. To dump the entire expression thoroughly, use the x command, which will dump the given value completely: DB<13> x @x 0 ‘first’ 1 ‘second’ 2 ‘third’ 3 ‘fourth’ 4 ‘fifth’ DB<14> That’s better, but it’s still a bit clunky, x is better used by giving it a reference … Read more

Generating a trace

Generating a trace with the perl debugger. Having the right tool for the job is essential. It’s all very well having a big, impressive hammer in your toolbox, but if you  ave a nut and a bolt to put together, you won’t get very far unless you have a spanner too. A trace is a report of … Read more

Debugging a Perl Program

Debugging a Perl Program It’s possible to start the debugger with a piece of Perl code as an argument by including the C<-e> switch on the command line. To debug a particular program instead, we substitute the program name to be debugged, along with any required arguments. So let’s do this with our current program (charcount) and dive into … Read more