diff options
Diffstat (limited to 'lib/App/REPL/Plugin/Interrupt.pm')
-rw-r--r-- | lib/App/REPL/Plugin/Interrupt.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/App/REPL/Plugin/Interrupt.pm b/lib/App/REPL/Plugin/Interrupt.pm index 346807e..d993a15 100644 --- a/lib/App/REPL/Plugin/Interrupt.pm +++ b/lib/App/REPL/Plugin/Interrupt.pm @@ -4,12 +4,20 @@ use warnings; use base 'App::REPL::Plugin'; -sub evaluate { +sub compile { my $self = shift; - my ($next, $line, %args) = @_; + my ($next, @args) = @_; local $SIG{INT} = sub { die "Interrupted" }; - $next->($line, %args); + $next->(@args); +} + +sub execute { + my $self = shift; + my ($next, @args) = @_; + + local $SIG{INT} = sub { die "Interrupted" }; + $next->(@args); } 1; |