- # first expand out the entry to a command
- ($path, $fcmd) = search($main::localcmd, $cmd, "pl");
- ($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
-
- my @ans = $self->eval_file($path, $fcmd, $args) if $path && $fcmd;
-# @ans = $self->eval_file($main::cmd, $cmd, $args) if !$ans[0];
- if ($ans[0]) {
- shift @ans;
- $self->send(@ans) if @ans > 0;
- } else {
- shift @ans;
- if (@ans > 0) {
- $self->msg('e2', @ans);
- } else {
- $self->msg('e1');
+ # first expand out the entry to a command
+ ($path, $fcmd) = search($main::localcmd, $cmd, "pl");
+ ($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
+
+ my $package = find_cmd_name($path, $fcmd);
+ @ans = (0, "Syserr: compile err on $package\n$@$errstr") if !$package ;
+
+ if ($package) {
+ my $c = qq{ \@ans = $package(\$self, \$args) };
+ dbg('eval', "cluster cmd = $c\n");
+ eval $c;
+ if ($@) {
+ @ans = (0, "Syserr: Eval err cached $package\n$@");
+ }