Sepia
view release on metacpan or search on metacpan
<br><dt><kbd>pwd</kbd><dd>Show the process's current working directory.
<br><dt><kbd>quit</kbd><dd>Exit the inferior Perl process.
<br><dt><kbd>reload [</kbd><var>module</var><kbd> | </kbd><var>/pattern/</var><kbd>]</kbd><dd>Reload <var>module</var> (but not its dependencies), or all modules matching
<var>pattern</var>.
<br><dt><kbd>freload </kbd><var>module</var><dd>Reload <var>module</var> and all of its dependencies.
<br><dt><kbd>restart</kbd><dd>Reload <samp><span class="file">Sepia.pm</span></samp> and recursively invoke the REPL. This command is
mostly of interest when working on Sepia itself, and will fail
catastrophically if <samp><span class="file">Sepia.pm</span></samp> fails to compile.
<br><dt><kbd>save [</kbd><var>pattern</var><kbd> [</kbd><var>file</var><kbd>]]</kbd><dd>Save variables matching <var>pattern</var> (or all variables) to <var>file</var>
(or <samp><span class="file">~/.sepia-save</span></samp>) in <code>Storable</code> format. Note that because
saving magic variables can have unpredictable results, using <kbd>save</kbd>
without a pattern argument is risky. Sepia excludes common magic
variables and dangerous packages, but its list is not foolproof.
<br><dt><kbd>shell [</kbd><var>command</var><kbd>]</kbd><dd>Execute shell command <var>command</var>, displaying its standard output and
standard error.
<br><dt><kbd>size </kbd><var>package</var><kbd> [</kbd><var>regexp</var><kbd>]</kbd><br><dt><kbd>size [</kbd><var>regexp</var><kbd>]</kbd><dd>List the variables in <var>package</var> (or the current package) along with
their total sizes. This requires the <code>Devel::Size</code> module. In
strict mode, list lexical variables if no <var>package</var> is given.
<br><dt><kbd>strict [</kbd><var>val</var><kbd>]</kbd><dd>Set evaluation strictness to <var>val</var>, or toggle it if <var>val</var> is not
given. Note that turning strictness off and on clears the REPL's
lexical environment.
<br><dt><kbd>test [</kbd><var>file</var><kbd>]</kbd><dd>Run tests in the current directory. If <var>file</var> is given, only run
test <var>file</var> or <samp><span class="file">t/</span><var>file</var></samp>
<br><dt><kbd>time [</kbd><var>val</var><kbd>]</kbd><dd>Set time display to <var>val</var>, or toggle it if <var>val</var> is not given.
With time display enabled, Sepia will use <code>BSD::Resource</code> and/or
<code>Time::HiRes</code> to display wall clock time and CPU usage for the
previous command as part of the prompt.
<br><dt><kbd>undef </kbd><var>name</var><dd>Undefine shortcut <var>name</var>. <strong>Warning</strong>: this can equally be
used to remove built-in shortcuts.
<br><dt><kbd>wantarray [</kbd><var>val</var><kbd>]</kbd><dd>Set the evaluation context to <var>val</var>: <code>@</code> means array, <code>$</code>
means scalar, and anything else means void.
<br><dt><kbd>who </kbd><var>package</var><kbd> [</kbd><var>regexp</var><kbd>]</kbd><dt><kbd>who [</kbd><var>regexp</var><kbd>]</kbd><dd>List identifiers in <var>package</var> (main by default) matching optional
<var>regexp.</var> In strict mode, list lexical variables if no
<var>package</var> is given.
</dl>
<p><a name="Debugger"></a>
<h3 class="section">3.2 Debugger</h3>
<p>Sepia uses Perl's debugger hooks and GUD mode to support conditional
breakpoints and single-stepping, and overrides Perl's <code>die()</code> 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.
<p>The debugger has its own set of shortcuts, also prefixed by a comma.
<dl>
<dt><kbd>backtrace</kbd><dd>Show a backtrace.
<br><dt><kbd>delete</kbd><dd>Delete the current breakpoint.
<br><dt><kbd>down </kbd><var>n</var><dt><kbd>up </kbd><var>n</var><dd>Move the current stack frame up or down by <var>n</var> (or one) frames.
<br><dt><kbd>inspect [</kbd><var>n</var><kbd>]</kbd><dd>Inspect lexicals in the current frame or frame <var>n</var>, counting upward
from 1.
<br><dt><kbd>next [</kbd><var>n</var><kbd>]</kbd><dd>Advance <var>n</var> (or one) lines, skipping subroutine calls.
<br><dt><kbd>quit</kbd><dt><kbd>die</kbd><dt><kbd>warn</kbd><dd>Continue as the program would have executed without debugger
intervention, dying if the debugger was called from <code>die()</code>.
<br><dt><kbd>return </kbd><var>expr</var><dd>Continue execution as if <code>die()</code> had returned the value of
<var>expr</var>, which is evaluated in the global environment.
<br><dt><kbd>step [</kbd><var>n</var><kbd>]</kbd><dd>Step forward <var>n</var> (or one) lines, descending into subroutines.
<br><dt><kbd>xreturn </kbd><var>sub</var> <var>expr</var><dd>Return <var>expr</var> from the innermost call to <var>sub</var>. This is a
somewhat dangerous and experimental feature, but is probably more useful
than returning a value from <code>die()</code>.
</dl>
<p><a name="Evaluation"></a>
<h3 class="section">3.3 Evaluation</h3>
<p>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</code>.
<dl>
<dt><kbd>C-M-x</kbd><dt><kbd>M-x sepia-eval-defun</kbd><dd><a name="index-sepia_002deval_002ddefun-25"></a>Evaluate the function around point in the inferior Perl process. If it
contains errors, jump to the location of the first.
<br><dt><kbd>C-c C-l</kbd><dt><kbd>M-x sepia-load-file</kbd><dd><a name="index-sepia_002dload_002dfile-26"></a>Save the current buffer, then reload its file and if warnings or errors
occur, display an error buffer. With a prefix argument, also rebuild
the cross-reference index.
<br><dt><kbd>C-c e</kbd><dt><kbd>M-x sepia-eval-expression <RET> </kbd><var>expr</var><kbd> <RET></kbd><dd><a name="index-sepia_002deval_002dexpression-27"></a>Evaluate <var>expr</var> in scalar context and echo the result. With a
prefix argument, evaluate in list context.
<br><dt><kbd>C-c!</kbd><dt><kbd>sepia-set-cwd</kbd><dd><a name="index-sepia_002dset_002dcwd-28"></a>Set the REPL's working directory to the current buffer's directory.
</dl>
<p><a name="Mutilation"></a>
<h3 class="section">3.4 Mutilation</h3>
<p>Sepia contains several functions to operate on regions of text using the
interactive Perl process. These functions can be used like standard
one-liners (e.g. `<samp><span class="samp">perl -pe ...</span></samp>'), with the advantage that all of
( run in 2.206 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )