使用 perl 调试器时,有没有办法跳出当前循环?
例如:
line 1
for($i=1;$i<100000:$i++)
{
line2
}
line3
我希望调试器跳出 for 循环并停在第 3 行
最佳答案
c 5
示范:
>perl -d
Loading DB routines from perl5db.pl version 1.33
Editor support available.
Enter h or `h h' for help, or `perldoc perldebug' for more help.
print "line1\n";
for (1..100000) {
print "line2\n";
}
print "line3\n";
^Z
main::(-:1): print "line1\n";
DB<1> s
line1
main::(-:2): for (1..100000) {
DB<1> s
main::(-:3): print "line2\n";
DB<1> s
line2
main::(-:3): print "line2\n";
DB<1> c 5
line2
line2
line2
...
line2
line2
line2
main::(-:5): print "line3\n";
DB<2> s
line3
Debugged program terminated. Use q to quit or R to restart,
关于Perl 调试器 - 如何跳出循环,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11173140/