When I call my Perl debugger with perl -d myscript.pl , the debugger starts, but it does not execute any code until I press n (next) or c (continue).
Is there anyway to call the debugger and run the default code until it reaches the breakpoint?
If so, is there any statement that I can use in my code as a breakpoint to stop the debugger when it hits it?
Update:
Here is what I have in the .perldb file:
print "Reading ~/.perldb options.\n"; push @DB::typeahead, "c"; parse_options("NonStop=1");
Here is my hello_world.pl file:
use strict; use warnings; print "Hello world.\n"; $DB::single=1; print "How are you?";
Here is a debugging debugging session: perl -d hello_world.pl :
Reading ~/.perldb options. Hello world main::(hello_world.pl:6): print "How are you?"; auto(-1) DB<1> c Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, hq, h R or ho to get additional info. DB<1> v 9563 9564 9565 sub at_exit { 9566==> "Debugged program terminated. Use `q' to quit or `R' to restart."; 9567 } 9568 9569 package DB; # Do not trace this 1; below! DB<1>
In other words, my debugger skips the print "How are you?" and instead stops after the program ends, which I donβt want.
I want the debugger to execute my code without stopping anywhere (neither at the beginning nor at the end of my script) , if I explicitly have the $DB::single=1; operator $DB::single=1; , in which case I would like it to stop before starting the next line. Any ways to do this?
For reference, I use:
$perl --version This is perl 5, version 14, subversion 1 (v5.14.1) built for x86_64-linux