7.1. Basic Operation

Normally perl runs your program unhindered, but the debugger is a way of allowing both perl and you to run your program together. At any point in the execution of your program you can have perl pause and tell you what it has done so far. Think of the Perl run-time system as a mouse that gobbles up a trail of bread crumbs that are the opcodes of your program. The debugger allows you to tell the mouse to stop at points of your choosing and interrogate it as to the contents of its digestive system. And if you don't like the values of some of the variables, you can change them (we will not attempt to extend our metaphor to include this).

In fact, the debugger for Perl is a plugin written using hooks enabled by the -d flag. It's possible to write programs that do things with those hooks other than present an interactive command line-oriented interface, and several people have done so. We've already seen one example, Devel::Coverage in Chapter 6, and we'll visit Devel::DProf in Chapter 11.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset