File: Turtles.pm

package info (click to toggle)
libdevel-repl-perl 1.002001-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 256 kB
  • ctags: 185
  • sloc: perl: 2,323; makefile: 47
file content (17 lines) | stat: -rw-r--r-- 341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package Devel::REPL::Plugin::Turtles;
use Moose::Role;
use namespace::clean -except => [ 'meta' ];

around 'eval' => sub {
    my $next = shift;
    my ($self, $line) = @_;
    if ($line =~ /^#(.*)/) {
        return $next->($self, ('$_REPL->' . $1 . '; return();'));
    }
    else {
        return $next->($self, $line);
    }
    
};

1;