in reply to debugger watchpoint behavior

I only have a workaround: set a break (or continue to the point) where %hash is initialized. Then create a reference to that hash with $href = \%hash, and watch with w $href->{'myEntry'}.

The variables you define in the debugger don't go out of scope. But note that the behavior of your code will change if you want %hash to go out of scope and maybe be re-initialized later: As long as the reference lives, %hash will stick around.

Replies are listed 'Best First'.
Re^2: debugger watchpoint behavior
by LanX (Saint) on May 26, 2024 at 22:54 UTC
    I didn't like the idea of having an extra reference count, because this smells like Heisenbug.

    So I thought weakening it might be a good idea, but then I realized that the reference might change and the global var will fail.

    Tricky. I could think of some approaches to solve this, but I'm AFK right now.

    And the OP didn't show us any code...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery