Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How to step over a line in the debugger?
May 23, 2005, 8:17 am
rate this thread
I just found myself needing to use the debugger to sort out a problem in one of
my administrative scripts, and I realized I needed a feature that seems obvious
enough for a debugger, but I can't find it mentioned in perldebug or the Camel.
Is it possible to step over an arbitrary line of code, without executing it?
Let's say I have a script with simple example code like this:
print "Line 1.\n";
print "Line 2.\n";
print "Line 3.\n";
What must I do to execute line 1 and 3, but not line 2, inside the debugger?
If I load the debugger and enter one s command to execute line 1, what do I
enter to skip the next line and go directly to the one following it?
I'm not a programmer by training, if this is obvious then please enlighten me.
Re: How to step over a line in the debugger?
No. The debugger is not directing the execution of your program, it is
observing it. All you can do is vary the places it stops to report what's
If line 2 contained a conditional, e.g.
print "Line 2.\n" if $foo;
you could set $foo to false in the debugger before reaching the line.
That's about it.