Suppose we wanted to step through the code inside subroutines like print_line. That’s the reason for s (single step). Let’s see how it’s used, along with another handy stepping command, r(return): % perl -d debug.plmain::(debug.pl:4): Hey); DB<1> n my @parole = qw(Salutations Hello main::(debug.pl:6): print_line(@parole); DB<1> s main::print_line(debug.pl:13): my @parole = @_; DB<1> n main::print_line(debug.pl:14): foreach (@parole) main::print_line(debug.pl:15): { DB<1> main::print_line(debug.pl:16): print “$_ Perl Worldn”; DB<1> r Salutations Perl World Hello Perl World Hey Perl World void context return from main::print_line main::(debug.pl:7): print “Donen”; DB<1> s Done Debugged program terminated. The effect of r is to execute all the code up to the end of the current subroutine. (All these command letters are copied from existing popular Unix command line debuggers and are mnemonic next, step, return). In addition, note that just hitting carriage return as a command repeats the last n or s command (and if there hasn’t been one yet, it does nothing). 7.2.2 Examining Variables: p, x, V Stepping through code is dandy, but how do we check our variables’ values? Use either pexpression to print the result of the expression (which is equivalent to printing to the filehandle $DB::OUT, so expressionis put in list context) or xvariable, which prints a variable in a pleasantly formatted form, following references. Once again, with the simple program: % perl -wd debug.pl main::(debug.pl:4): my @parole = qw(Salutations Hello Hey); DB<1> p @parole DB<2> n main::(debug.pl:6): print_line(@parole); DB<2> p @parole SalutationsHelloHey DB<3> x @parole
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services