-
-
16 Feb 2016 01:15:26 UTC
- Distribution: Devel-REPL
- Module version: 1.003028
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (31)
- Testers (5220 / 1 / 0)
- Kwalitee
Bus factor: 10- 57.95% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (59.45KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 21 contributors- Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>)
-
Shawn M Moore
-
Chris Marshall
-
Matt S Trout
-
Oliver Gorwits
-
ΧΧΧΧ Χ§ΧΧ'ΧΧ (Yuval Kogman)
-
Arthur Axel 'fREW' Schmidt
-
Andrew Moore
-
Alexis Sukrieh
-
Tomas Doran (t0m)
- epitaph <unknown>
-
Norbert Buchmuller
-
Jesse Luehrs
-
Dave Houston
-
Dagfinn Ilmari MannsΓ₯ker
-
Zakariyya Mughal
-
Ryan Niebur
-
Justin Hunter
-
Ash Berlin
-
naquad
-
Stevan Little
- Dependencies
- B::Concise
- Devel::Peek
- File::HomeDir
- File::Spec
- JSON::PP
- Module::Runtime
- Moose
- Moose::Meta::Role
- Moose::Role
- MooseX::Getopt
- MooseX::Object::Pluggable
- Scalar::Util
- Task::Weaken
- Term::ANSIColor
- Term::ReadLine
- Time::HiRes
- namespace::autoclean
- strict
- warnings
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Devel::REPL::Plugin::OutputCache - Remember past results, _ is most recent
VERSION
version 1.003028
SYNOPSIS
> 21 / 7 3 > _ * _ 9 > sub { die "later" } sub { die "later" } > _->() Runtime error: later
DESCRIPTION
Re-using results is very useful when working in a REPL. With
OutputCache
you get_
, which holds the past result. The benefit is that you can build up your result instead of having to type it in all at once, or store it in intermediate variables.OutputCache
also provides$_REPL->output_cache
, an array reference of all results in this session.Devel::REPL already has a similar plugin, Devel::REPL::Plugin::History. There are some key differences though:
- Input vs Output
-
History
remembers input.OutputCache
remembers output. - Munging vs Pure Perl
-
History
performs regular expressions on your input.OutputCache
provides the_
sub as a hook to get the most recent result, and$_REPL->output_cache
for any other results. - Principle of Least Surprise
-
History
will replace exclamation points in any part of the input. This is problematic if you accidentally include one in a string, or in anot
expression.OutputCache
uses a regular (if oddly named) subroutine so Perl does the parsing -- no surprises.
CAVEATS
The
_
sub is shared across all packages. This means that if a module is using the_
sub, then there is a conflict and you should not use this plugin. For example, Jifty uses the_
sub for localization. Jifty is the only known user.SEE ALSO
Devel::REPL
,Devel::REPL::Plugin::History
SUPPORT
Bugs may be submitted through the RT bug tracker (or bug-Devel-REPL@rt.cpan.org).
There is also an irc channel available for users of this distribution, at
#devel
onirc.perl.org
.AUTHOR
Shawn M Moore,
<sartak at gmail dot com>
COPYRIGHT AND LICENSE
Copyright (C) 2007 by Shawn M Moore
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Devel::REPL, copy and paste the appropriate command in to your terminal.
cpanm Devel::REPL
perl -MCPAN -e shell install Devel::REPL
For more information on module installation, please visit the detailed CPAN module installation guide.