… | |
… | |
20 | |
20 | |
21 | while (defined (print $fh "cmd> "), $_ = <$fh>) { |
21 | while (defined (print $fh "cmd> "), $_ = <$fh>) { |
22 | s/\015?\012$//; |
22 | s/\015?\012$//; |
23 | if (s/^(\S+)\s*// && (my $cmd = $complete{$1})) { |
23 | if (s/^(\S+)\s*// && (my $cmd = $complete{$1})) { |
24 | if ($cmd eq "quit") { |
24 | if ($cmd eq "quit") { |
25 | print "bye bye.\n";#d# |
25 | print $fh "bye bye.\n";#d# |
26 | last; |
26 | last; |
27 | } elsif ($cmd eq "squit") { |
27 | } elsif ($cmd eq "squit") { |
|
|
28 | print $fh "server quit.\n";#d# |
28 | Event::unloop; |
29 | Event::unloop; |
29 | last; |
30 | last; |
30 | } elsif ($cmd eq "print") { |
31 | } elsif ($cmd eq "print") { |
31 | my @res = eval $_; |
32 | my @res = eval $_; |
32 | print $fh "eval: $@\n" if $@; |
33 | print $fh "eval: $@\n" if $@; |