Next: , Previous: Shortcuts, Up: Interactive Perl


3.2 Debugger

Unfortunately Sepia does not use Perl's debugger hooks, so it does not support a true debugger with breakpoints, single-stepping, etc. However, the REPL overrides the die() and warn() operators, allowing it to intercept failures while their context is still available. This makes it possible to produce a backtrace, inspect and modify global variables, and continue execution. If the PadWalker module is available, Sepia also provides functions to inspect and modify lexical variables.

The debugger has its own set of shortcuts, also prefixed by a comma.

backtrace
Show a backtrace with Carp::cluck.
inspect n
Inspect lexicals in frame n, counting upward (requires PadWalker).
eval n expr
Evaluate expr in the lexical environment of frame n (requires PadWalker). expr should not transfer control out of this environment, but is free to modify its lexicals.
return expr
Continue execution as if die() or warn() had returned the value of expr, which is evaluated in the global environment.
die
warn
Continue dying or warning as the program would have done without debugger intervention.