X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=522200da3b8249cb74f3bc492a92fa1862d17331;hb=27854d917fc31b9f2dd184c24e6f38265a3a09e8;hp=5348212d620ceb7c09626f5c9d7f56ef3d5690a8;hpb=6a0068ec3df1dca0c6ae2714af3c0a4a62998dcf;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 5348212d..522200da 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -124,7 +124,7 @@ sub normal ($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 ; + @ans = (0) if !$package ; if ($package) { my $c = qq{ \@ans = $package(\$self, \$args) }; @@ -137,15 +137,13 @@ sub normal } } -# 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->send($self->msg('e2', @ans)); + $self->send($self->msg('e2'), @ans); } else { $self->send($self->msg('e1')); } @@ -394,6 +392,7 @@ sub find_cmd_name { my $fh = new FileHandle; if (!open $fh, $filename) { $errstr = "Syserr: can't open '$filename' $!"; + return undef; }; local $/ = undef; my $sub = <$fh>; @@ -424,7 +423,6 @@ sub find_cmd_name { print "\$\@ = $@"; $errstr = $@; delete_package($package); - $package = undef; } else { #cache it unless we're cleaning out each time $Cache{$package}{mtime} = $mtime; @@ -433,6 +431,7 @@ sub find_cmd_name { #print Devel::Symdump->rnew($package)->as_string, $/; $package = "DXCommandmode::$package" if $package; + $package = undef if $errstr; return $package; }