1 package Devel::REPL::Plugin::Turtles;
3 use namespace::clean -except => [ 'meta' ];
7 my ($self, $line) = @_;
8 if ( my ( $command, $rest ) = ( $line =~ /^#(\w+)\s*(.*)/ ) ) {
9 if ( my $cont = $self->can("continue_reading_if_necessary") ) {
10 $rest = $self->$cont($rest);
13 my $method = "command_$command";
15 if ( $self->can($method) ) {
16 return $self->$method($rest);
18 return $self->error_return("REPL error", "Command '$command' does not exist");
22 return $next->($self, $line);