On Tue, Nov 17, 2009 at 11:11 AM, Parag Kalra <paragka...@gmail.com> wrote:
> It happens so many times that while debugging I come inside a loop which > doesn't contain the issue which I am debugging. > > And as I am not aware of a method to complete the loop while debugging - I > manually enter 'n' to complete each iteration and finish the loop > operation. > > And then again continue debugging outside the loop. This may be very > tedious > if loop involves an array or a file which is very large in size. > Will the "c" command work for you? "c line" continues until it reaches the given line. So if you know the line number after the loop, you can bypass the loop. For example... # perl -d -e 'foreach (1..5) {print "$_\n"; } >print "done\n"; >' Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): foreach (1..5) {print "$_\n"; } DB<1> n main::(-e:1): foreach (1..5) {print "$_\n"; } DB<1> n 1 main::(-e:1): foreach (1..5) {print "$_\n"; } DB<1> c 2 2 3 4 5 main::(-e:2): print "done\n"; DB<2> The "c 2" continues until it reaches line 2 - outside of the loop. HTH -- Robert Wohlfarth