X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=blobdiff_plain;f=lib%2FDevel%2FREPL%2FPlugin%2FTurtles.pm;fp=lib%2FDevel%2FREPL%2FPlugin%2FTurtles.pm;h=dbc73226b8dd7fb493c3d7a3052db2327df19135;hp=0000000000000000000000000000000000000000;hb=e958cbc628b42fa7a2ed91d34e097d2224b77197;hpb=911a1c242561b001192b9541b3aa813fe0b70b41 diff --git a/lib/Devel/REPL/Plugin/Turtles.pm b/lib/Devel/REPL/Plugin/Turtles.pm new file mode 100644 index 0000000..dbc7322 --- /dev/null +++ b/lib/Devel/REPL/Plugin/Turtles.pm @@ -0,0 +1,16 @@ +package Devel::REPL::Plugin::Turtles; +use Moose::Role; + +around 'eval' => sub { + my $next = shift; + my ($self, $line) = @_; + if ($line =~ /^#(.*)/) { + return $next->($self, ('$self->' . $1 . '; return();')); + } + else { + return $next->($self, $line); + } + +}; + +1; \ No newline at end of file