App-REPL
view release on metacpan or search on metacpan
}
use constant EPI => <<'EOE';
;
no strict 'refs';
for (Symbol::qualify('')) { s/::$//; main::in_package($_) }
${main::in_package . '::REPL::env'} = PadWalker::peek_my(0)
EOE
# ----------------------------------------------------------------------
# More magic. This finds the final statement of some Perl, wherever
# that statement may be (even if its result cannot escape the overall
# evaluation), and saves its value in $App::REPL::ret
#--
$App::REPL::ret = '';
{ my $f = PPI::Find->new(sub { shift->isa('PPI::Statement') });
sub save_ret {
my $d = shift;
# don't even try if it contains something troublesome.
return $d->serialize if has_troublesome($d);
( run in 0.661 second using v1.01-cache-2.11-cpan-c21f80fb71c )