[Chicago-talk] debugger: watch expressions

Greg Fast gdf at speakeasy.net
Wed Dec 3 14:38:31 CST 2003


I just noticed that the 5.8.0 debugger does have a command to set
watch variables: 'w'.

      DB<1> l
    4==>    my $x = 0;
    5:      foreach my $n (0..1000) {
    6:        $x += $n if $n>500;
    7       }
    8 
      DB<1> n
    main::(xxx.pl:5):       foreach my $n (0..1000) {
      DB<1> w $x
      DB<2> c
    Watchpoint 0:   $x changed:
    	    old value:      '0'
    	    new value:      '501'
    main::(xxx.pl:5):       foreach my $n (0..1000) {
      DB<2>

The perldebug manpage describes 'w' this way:

       w expr      Add a global watch-expression.  We hope you know
                   what one of these is, because they're supposed to
                   be obvious.

(which is annoying, since that's exactly what I wasn't sure I knew).

I Enjoyed the presentation last night, and learned a few new tricks (a
bunch of new db commands seem to have appeared with 5.8).  So thanks,
Steven.

--
Greg Fast
http://cken.chi.groogroo.com/~gdf/



More information about the Chicago-talk mailing list