![]() As a result any newly introduced lexical variable or any modified capture buffer content is lost after the eval. Note that the said eval is bound by an implicit scope. ![]() ![]() (The debugger uses the DB package for keeping its own state information.) Contrary to popular expectations, whenever the debugger halts and shows you a line of code, it always displays the line it's about to execute, rather than the one it has just executed.Īny command not recognized by the debugger is directly executed ( eval'd) as Perl code in the current package. The program will halt right before the first run-time executable statement (but see below regarding compile-time statements) and ask you to enter a debugger command. Then when the interpreter starts up, it preloads a special Perl library file containing the debugger. That means your code must first compile correctly for the debugger to work on it. Instead, the -d flag tells the compiler to insert source information into the parse trees it's about to hand off to the interpreter. In Perl, the debugger is not a separate program the way it usually is in the typical compiled environment. This is so convenient that you often fire up the debugger all by itself just to test out Perl constructs interactively to see what they do. This works like an interactive Perl environment, prompting for debugger commands that let you examine source code, set breakpoints, get stack backtraces, change the values of variables, etc. If you invoke Perl with the -d switch, your script runs under the Perl source debugger. If you're looking for the nitty gritty details of how the debugger is implemented, you may prefer to read perldebguts.įor in-depth technical usage details, see, the documentation of the debugger itself. If you're new to the Perl debugger, you may prefer to read perldebtut, which is a tutorial introduction to the debugger. Readline Support / History in the Debuggerįirst of all, have you tried using use strict and use warnings ?.
0 Comments
Leave a Reply. |