Perl Best Practices [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Best Practices [Electronic resources] - نسخه متنی

Damian Conway

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







18.11. The Debugger


Learn at least a subset of the

perl debugger .


Perl's integrated debugger makes it very easy to watch your program's internal state change as it executes. At the very least, you should be familiar with the basic features summarized in Table 18-1.

Table 18-1. Debugger basics

Debugging task

Debugger command

To run a program under the debugger

> perl -dprogram.pl

To set a breakpoint at the current line

DB<1> b

To set a breakpoint at line 42

DB<1> b 42

To continue executing until the next break-point is reached

DB<1> c

To continue executing until line 86

DB<1> c 86

To continue executing until subroutine foo is called

DB<1>c foo

To execute the next statement

DB<1> n

To step into any

s ubroutine call that's part of the next statement

DB<1> s

To run until the current subroutine

r eturns

DB<1> r

To examine the contents of a variable

DB<1> x $variable

To have the debugger watch a variable or expression, and inform you whenever it changes

DB<1>w$variable

DB<1> wexpr($ess)*$ion

To view where you are in the source code

DB<1> v

To view line 99 of the source code

DB<1> v 99

To get helpful hints on the many other features of the debugger

DB<1> |h h

The standard perldebug and perldebtut documentation provide much more detail on using the debugger. You can also download and print out a handy free summary of the most commonly used commands from http://www.perl.com/2004/11/24/debugger_ref.pdf.


/ 317