blob: 28eb3466378feb941f3e468cd867653da631ddb6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
package App::REPL::Plugin::Defaults;
use strict;
use warnings;
use base 'App::REPL::Plugin';
sub display_prompt {
my $self = shift;
print "> ";
}
sub read_line {
my $self = shift;
return scalar <>;
}
sub evaluate {
my $self = shift;
my ($next, $line) = @_;
return eval $line;
}
sub print_error {
my $self = shift;
my ($next, $error) = @_;
print $error, "\n"
if defined $error;
}
sub print_result {
my $self = shift;
my ($next, $result) = @_;
print $result, "\n"
if defined $result;
}
1;
|