Commit | Line | Data |
---|---|---|
e958cbc6 | 1 | package Devel::REPL::Plugin::Turtles; |
2 | use Moose::Role; | |
48ddfeae | 3 | use namespace::clean -except => [ 'meta' ]; |
e958cbc6 | 4 | |
5 | around 'eval' => sub { | |
6 | my $next = shift; | |
7 | my ($self, $line) = @_; | |
8 | if ($line =~ /^#(.*)/) { | |
48ddfeae | 9 | return $next->($self, ('$REPL->' . $1 . '; return();')); |
e958cbc6 | 10 | } |
11 | else { | |
12 | return $next->($self, $line); | |
13 | } | |
14 | ||
15 | }; | |
16 | ||
48ddfeae | 17 | 1; |