summaryrefslogtreecommitdiffstats
path: root/lib/App/REPL/Plugin/Defaults.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/REPL/Plugin/Defaults.pm')
-rw-r--r--lib/App/REPL/Plugin/Defaults.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/App/REPL/Plugin/Defaults.pm b/lib/App/REPL/Plugin/Defaults.pm
index 23368e8..ab533b4 100644
--- a/lib/App/REPL/Plugin/Defaults.pm
+++ b/lib/App/REPL/Plugin/Defaults.pm
@@ -27,7 +27,7 @@ sub read_line {
my $PREFIX = "package main; BEGIN { \$^H = \$" . __PACKAGE__ . "::default_hints; \%^H = \%\$" . __PACKAGE__ . "::default_hinthash; \${^WARNING_BITS} = \$" . __PACKAGE__ . "::default_warning_bits }";
-sub evaluate {
+sub compile {
my $self = shift;
my ($next, $line, %args) = @_;
@@ -35,7 +35,14 @@ sub evaluate {
source => "sub { $PREFIX; $line }",
terse_error => 1,
%args,
- )->();
+ );
+}
+
+sub execute {
+ my $self = shift;
+ my ($next, $code) = @_;
+
+ return $code->();
}
sub print_error {