in reply to Debugger Questions - Variable Scope

IIRC are watch expressions just evaled text, and there is no way to tell plain Perl which pad a lexical var belongs to.

So no official way AFAIK ...

... BUT since watch expressions are just evaled text (sic ;-) you can use hacks to restrict them to a range of lines or to be dependent on caller.

I'm too lazy now to fiddle around by myself, but this thread should show you some approaches:

Make debugger break on source lines matching a pattern

HTH! =)

Cheers Rolf

( addicted to the Perl Programming Language)

  • Comment on Re: Debugger Questions - Variable Scope

Replies are listed 'Best First'.
Re^2: Debugger Questions - Variable Scope
by GotToBTru (Prior) on May 16, 2014 at 15:50 UTC

    Some ideas to explore here. The YAPC talk referenced seems especially interesting for this problem and others.

    1 Peter 4:10
      > The YAPC talk referenced seems especially interesting for this problem and others.

      hmm not really, I didn't try to mess with "watch".

      I'm personally using and testing my patched version for years now, and there are edge cases where it fails.

      The debugger really needs refactoring and modularization.

      For instance the command-loop spreads over hundreds and hundreds of lines with if-blocks on regex-conditions and interwoven POD as documentation, where order matters. Thats extremely hard to patch.

      Plus there doesn't seem to be any test suite. :(

      Cheers Rolf

      ( addicted to the Perl Programming Language)