in reply to Infinite loop with each

If the debugger is doing something that reads %some_hash, that will affect where the each() iterator is. If it reads all of %some_hash, or does scalar context keys or values on it, the next each() will return the first key/value every time.

Replies are listed 'Best First'.
Re^2: Infinite loop with each
by Kursad (Initiate) on Jun 05, 2008 at 03:39 UTC

    I am pretty sure the debugger is reading the contents of %some_hash. Because EPIC debugger uses padwalker module to take a look into lexical variables. It displays the variables in a window and at every step of the debugging, that window is refreshed.

    What is the best way to debug perl? Even such simple debugging is creating problems of its own. I just need to see variables at every step, and I need to know what the program does in each step. In that code for ex, the stepping is not working properly either, I cannot see the statement inside the while condition being executed.

    I'm just looking for a GUI based IDE that is easy to use so I can focus on my code rather than peculiarities of debugger.

        There is a pretty good chance that the "built in Perl debugger" is the one that epic is leveraging to provide debugging in Eclipse.


        Perl is environmentally friendly - it saves trees
Re^2: Infinite loop with each
by HelenCr (Monk) on Jun 01, 2012 at 10:36 UTC
    Guys: this seems to be a known problem in Perl 5 debugger.

    I have encountered this problem both in Padre and in EPIC on Eclipse. So it's not a Padre or Eclipse/EPIC problem. It's a Perl 5 debugger problem.

    See here (already in 2006) and here.

    This should be in PerlFaq, in my opinion. Has anyone found a solution?