Notice that trace mode causes the debugger to output the call tree when execution enters the print_line subroutine. 7.2.9 Programmatic Interaction with the Debugger You can put code in your program to force a call to the debugger at a particular point. For instance, suppose you’re processing a long input file line by line and you want to start tracing when it reaches a particular line. You could set a conditional breakpoint, but you could also extend the semantics of your input by creating “enable debugger” lines. Consider the following code: while () { $DB::trace = 1, next if /debug/; $DB::trace = 0, next if /nodebug/; # more code } When run under the debugger, this enables tracing when the loop encounters an input line containing “debug” and ceases tracing upon reading one containing “nodebug”. You can even force the debugger to breakpoint by setting the variable $DB::singleto 1, which also happens to provide a way you can debug code in BEGIN blocks (which otherwise are executed before control is given to the debugger). 7.2.10 Optimization Although the Perl debugger displays lines of code as it runs, it’s important to note that these are not what actually executes. Perl internally executes its compiled opcode tree, which doesn’t always have a contiguous mapping to the lines of code you typed, due to the processes of compilation and optimization. If you have used interactive debuggers on C code in the past, you may be familiar with this process. When debugging C programs on VAX/VMS, it was common for me to want to examine an important variable only to get the message that the variable was not in memory and had been “optimized away.” Perl has an optimizer to do as good a job as it can in the short amount of time people will wait for compilation of taking shortcuts in the code you’ve given it. For instance, in a process called constant folding, it does things like build a single string in places where you concatenate various constant strings together so that the concatenation operator need not be called at run-time. The optimization process also means that perl may execute opcodes in an order different from the order of statements in your program, and therefore when the debugger displays the
Note: If you are looking for good and high quality web space to host and run your java application check Vision java hosting services