The Perl Debugger #16


W <expression> - Set a watchpoint

  • set a watch expression for the debugger to monitor.

  • If the value of the expression changes, the debugger returns control to the user.

           DB<1> W $buggyValue
           DB<2> c
         Watchpoint 0:  $buggyValue changed:
                 old value:  '1982'
                 new value:  '1983'
         main::(      for($x=1;$x<2500;$x++) {
  • to delete all watchpoints, specify no parameter

  • Performance penalty - so only watch one or two values at a time

(see example)

<< Previous | Index | Next >> Copyright © 2002 Daniel Allen