agaved has asked for the wisdom of the Perl Monks concerning the following question:

I want to observe the value that a variable takes after any step/continue that I do in the debugger.

I can type 's' and then 'x $variable', but in this case I have to enter two commands every time: no biggie but a bit annoying. I wonder if there is any way to concatenate the two commands, so that at every step I can just recall the last line.

I tried 's, x $variable', 's; x $variable', 's - x $variable' with no success.

It seems a pretty standard feature for a debugger but I couldn't find any information on this.

Replies are listed 'Best First'.
Re: 'Step and see' a variable in Perl debugger
by choroba (Cardinal) on Apr 21, 2012 at 16:07 UTC
    See w to add "watch" expression or < to add a pre-prompt command.
Re: 'Step and see' a variable in Perl debugger
by zentara (Cardinal) on Apr 21, 2012 at 17:49 UTC
    Alternatively, you can use the Tk frontend to the debugger, Devel::ptkdb. It pops open a Tk window to show everything. You can see how every variable is affected as you step thru.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh