Commit | Line | Data |
---|---|---|
54d0f9a0 | 1 | package Devel::REPL::Plugin::Interrupt; |
2 | ||
3 | use Moose::Role; | |
4 | use namespace::clean -except => [ 'meta' ]; | |
5 | ||
6 | around 'eval' => sub { | |
7 | my $orig = shift; | |
8 | my ($self, $line) = @_; | |
9 | ||
10 | local $SIG{INT} = sub { | |
11 | die "Interrupted.\n"; | |
12 | }; | |
13 | ||
14 | return $self->$orig($line); | |
15 | }; | |
16 | ||
17 | 1; | |
18 |