… | |
… | |
9 | use Text::Abbrev; |
9 | use Text::Abbrev; |
10 | |
10 | |
11 | my $last_ts = time; |
11 | my $last_ts = time; |
12 | |
12 | |
13 | my %complete; |
13 | my %complete; |
14 | my @commands = qw(quit squit refresh country restart block info eval); |
14 | my @commands = qw(quit squit refresh country restart block info print); |
15 | |
15 | |
16 | abbrev \%complete, @commands; |
16 | abbrev \%complete, @commands; |
17 | |
17 | |
18 | sub shell { |
18 | sub shell { |
19 | my $fh = shift; |
19 | my $fh = shift; |
… | |
… | |
25 | print "bye bye.\n";#d# |
25 | print "bye bye.\n";#d# |
26 | last; |
26 | last; |
27 | } elsif ($cmd eq "squit") { |
27 | } elsif ($cmd eq "squit") { |
28 | Event::unloop; |
28 | Event::unloop; |
29 | last; |
29 | last; |
30 | } elsif ($cmd eq "eval") { |
30 | } elsif ($cmd eq "print") { |
31 | my @res = eval $_; |
31 | my @res = eval $_; |
32 | print $fh "eval: $@\n" if $@; |
32 | print $fh "eval: $@\n" if $@; |
33 | print $fh "RES = ", (join " : ", @res), "\n"; |
33 | print $fh "RES = ", (join " : ", @res), "\n"; |
34 | } elsif ($cmd eq "block") { |
34 | } elsif ($cmd eq "block") { |
35 | print "blocked '$_'\n";#d# |
35 | print "blocked '$_'\n";#d# |