Chapter 6. Debugging

Of course everyone writes perfect code on the first try, but on those rare occasions when something goes wrong, and you’re having trouble with your Perl script, there are several things you can do:

  • Run the script with the -w switch, which prints warnings about possible problems in your code.

  • Use the Perl debugger.

  • Use another debugger, or a profiler such as the Devel::DProf module.

The major focus of this chapter is the Perl debugger, which provides an interactive Perl environment. The chapter also describes the DProf module and the dprofpp program that comes with it; together they can provide you with a profile of your Perl script. If you’ve ever used any debugger, and you understand concepts such as breakpoints and backtraces, you’ll have no trouble learning to use the Perl debugger. Even if you haven’t used another debugger, the command descriptions and some experimenting should get you going.

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

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