in reply to How to skip a step in perldebug?

Regarding your second question
would it be possible to dynamically modify a line statement via the interactive debugger?
I also don't know.
What I do is the same trick that in the previous solution but before the goto L I do the "substituting" statement like in:
pp2@nereida:~/Ltesting$ perl -wd skipdeb.pl Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(skipdeb.pl:2): my $a = 4; DB<1> l 2==> my $a = 4; 3: my $b = 4; 4: my $c = 4; 5 6: $a = 5; 7: $a += 1; 8: L:$a = $c*$a; 9: $a = $c*$b; 10: print "$a\n"; DB<1> c 6 main::(skipdeb.pl:6): $a = 5; DB<2> b 9 DB<3> $a = 8 # This statement substitutes the skipped ones DB<4> goto L main::(skipdeb.pl:9): $a = $c*$b; DB<5> p $a 32

Replies are listed 'Best First'.
Re^2: How to skip a step in perldebug?
by repellent (Priest) on Aug 07, 2008 at 21:28 UTC
    Yes, skipping & entering your own code expression instead is akin to modifying the line statement.

    I was also wondering about issues like breaking scope, etc. Here's a made-up example:
    1: while (<STDIN>) { 2: push(@F, $_); 3==> shift(@F) if $. > 10; 4 }
    I wish to replace line 3 with
    shift(@F) if $. > 10; }{ print @F;
    instead. This modification still results in valid code.

    How far can we push this?