diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-05-30 03:12:25 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-05-30 03:12:25 -0500 |
commit | 071e98547d4dda83c29ea87cd4cff9115667bf24 (patch) | |
tree | 5b20f0019eb42b385f7a452c973991a1149ef625 /lib/App/REPL/Plugin/Interrupt.pm | |
parent | 34218fd2af78b254dd424de2289981621ee85f94 (diff) | |
download | reply-071e98547d4dda83c29ea87cd4cff9115667bf24.tar.gz reply-071e98547d4dda83c29ea87cd4cff9115667bf24.zip |
split evaluate into compile and execute
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; |