Sepia
view release on metacpan or search on metacpan
Reload @file{Sepia.pm} and recursively invoke the REPL. This command is
mostly of interest when working on Sepia itself, and will fail
catastrophically if @file{Sepia.pm} fails to compile.
@item save [@var{pattern} [@var{file}]]
Save variables matching @var{pattern} (or all variables) to @var{file}
(or @file{~/.sepia-save}) in @code{Storable} format. Note that because
saving magic variables can have unpredictable results, using @kbd{save}
without a pattern argument is risky. Sepia excludes common magic
variables and dangerous packages, but its list is not foolproof.
@item shell [@var{command}]
Execute shell command @var{command}, displaying its standard output and
standard error.
@item size @var{package} [@var{regexp}]
@item size [@var{regexp}]
List the variables in @var{package} (or the current package) along with
their total sizes. This requires the @code{Devel::Size} module. In
strict mode, list lexical variables if no @var{package} is given.
@item strict [@var{val}]
Set evaluation strictness to @var{val}, or toggle it if @var{val} is not
given. Note that turning strictness off and on clears the REPL's
lexical environment.
@item test [@var{file}]
Run tests in the current directory. If @var{file} is given, only run
test @var{file} or @file{t/@var{file}}
@item time [@var{val}]
Set time display to @var{val}, or toggle it if @var{val} is not given.
With time display enabled, Sepia will use @code{BSD::Resource} and/or
@code{Time::HiRes} to display wall clock time and CPU usage for the
previous command as part of the prompt.
@item undef @var{name}
Undefine shortcut @var{name}. @strong{Warning}: this can equally be
used to remove built-in shortcuts.
@item wantarray [@var{val}]
Set the evaluation context to @var{val}: @code{@@} means array, @code{$}
means scalar, and anything else means void.
@item who @var{package} [@var{regexp}]
@itemx who [@var{regexp}]
List identifiers in @var{package} (main by default) matching optional
@var{regexp.} In strict mode, list lexical variables if no
@var{package} is given.
@end table
@node Debugger, Evaluation, Shortcuts, Interactive Perl
@section Debugger
Sepia uses Perl's debugger hooks and GUD mode to support conditional
breakpoints and single-stepping, and overrides Perl's @code{die()} to
invoke the debugger rather than unwind the stack. This makes it
possible to produce a backtrace, inspect and modify global variables,
and even continue execution when a program tries to kill itself. 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.
@table @kbd
@item backtrace
Show a backtrace.
@item delete
Delete the current breakpoint.
@item down @var{n}
@itemx up @var{n}
Move the current stack frame up or down by @var{n} (or one) frames.
@item inspect [@var{n}]
Inspect lexicals in the current frame or frame @var{n}, counting upward
from 1.
@item next [@var{n}]
Advance @var{n} (or one) lines, skipping subroutine calls.
@item quit
@itemx die
@itemx warn
Continue as the program would have executed without debugger
intervention, dying if the debugger was called from @code{die()}.
@item return @var{expr}
Continue execution as if @code{die()} had returned the value of
@var{expr}, which is evaluated in the global environment.
@item step [@var{n}]
Step forward @var{n} (or one) lines, descending into subroutines.
@item xreturn @var{sub} @var{expr}
Return @var{expr} from the innermost call to @var{sub}. This is a
somewhat dangerous and experimental feature, but is probably more useful
than returning a value from @code{die()}.
@end table
@node Evaluation, Mutilation, Debugger, Interactive Perl
@section Evaluation
When interactive Perl is running, Sepia can evaluate regions of code in
the inferior Perl process. The following commands assume that this
process has already been started by calling @code{sepia-repl}.
@table @kbd
@item C-M-x
@itemx M-x sepia-eval-defun
@findex sepia-eval-defun
Evaluate the function around point in the inferior Perl process. If it
contains errors, jump to the location of the first.
@item C-c C-l
@itemx M-x sepia-load-file
@findex sepia-load-file
Save the current buffer, then reload its file and if warnings or errors
( run in 1.579 second using v1.01-cache-2.11-cpan-5b529ec07f3 )