Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

devel::repl::plugin::outputcache(3pm) [debian man page]

Devel::REPL::Plugin::OutputCache(3pm)			User Contributed Perl Documentation		     Devel::REPL::Plugin::OutputCache(3pm)

NAME
Devel::REPL::Plugin::OutputCache - remember past results, _ is most recent 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 a "not" 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" 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. perl v5.14.2 2010-05-08 Devel::REPL::Plugin::OutputCache(3pm)

Check Out this Related Man Page

App::REPL(3pm)						User Contributed Perl Documentation					    App::REPL(3pm)

NAME
App::REPL - A container for functions for the iperl program VERSION
Version 0.01 SYNOPSIS
This module contains functions that the iperl program automatically imports into any package it enters, for interactive convenience. Please see the README for general information. EXPORT
FUNCTIONS
x Print arguments with "Data::Dumper::Dumper" p Print arguments with "print" env Return a hashref containing the (stored -- not current) lexical environment. ret Return a reference to the value of the previous evaluation -- that is, a reference to whatever irepl printed after the last Perl you evaluated. This function will probably evolve to take an argument $n, to return the $n'th previous result. rdebug ($value) With no arguments, bump $REPL::DEBUG. With an argument, set $REPL::DEBUG to that. This is for debugging iperl itself; currently at 1 it shows eval'd code, and at 2 it dumps the PPI document corresponding to entered code. help (commands) With no arguments, print a brief message. With an argument, either print corresponding help or -- in the case of 'commands', currently the only optional argument -- call perldoc appropriately. AUTHOR
Julian Fondren, "<ayrnieu@cpan.org>" BUGS
Does not reliably report errors in eval'd code. Does not try hard enough to collect a return value from eval'd code. Makes probably dangerous use of PPI. Please report any bugs or feature requests to "bug-app-repl@rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-REPL>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. VERSION CONTROL
A subversion repository with anonymous checkout exists at http://OpenSVN.csie.org/app_repl , and you can also browse the repository from that URL with a web browser. COPYRIGHT &; LICENSE Copyright 2007 Julian Fondren, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2007-04-10 App::REPL(3pm)
Man Page