sub Dict {
my ($query) = @_;
-### return unless &main::loadPerlModule("IO::Socket");
+### return unless &::loadPerlModule("IO::Socket");
my $socket = new IO::Socket;
my @results;
my $total = scalar @results;
if (defined $num and ($num > $total or $num < 0)) {
- &msg($main::who, "error: choice in definition is out of range.");
+ &msg($::who, "error: choice in definition is out of range.");
return;
}
} else {
# suggested by larne and others.
my $prefix = "Dictionary '$query' ";
- $retval = &main::formListReply(1, $prefix, @results);
+ $retval = &::formListReply(1, $prefix, @results);
}
} elsif ($total == 1) {
$retval = "Dictionary '$query' ".$results[0];
}
}
- &main::performStrictReply($retval);
+ &::performStrictReply($retval);
}
sub Dict_Wordnet {
my ($socket, $query) = @_;
my @results;
- &main::status("Dict: asking Wordnet.");
+ &::status("Dict: asking Wordnet.");
print $socket "DEFINE wn \"$query\"\n";
my $def = "";
} elsif (/^\s+(\S+ )?(\d+)?: (.*)/) { # start of sub def.
my $text = $3;
$def =~ s/\s+$//;
-### &main::DEBUG("def => '$def'.");
+### &::DEBUG("def => '$def'.");
push(@results, $def) if ($def ne "");
$def = $text;
if (0) { # old non-fLR format.
$def = "$query $wordtype: $text" if (defined $text);
$wordtype = substr($1,0,-1) if (defined $1);
-### &main::DEBUG("_ => '$_'.") if (!defined $text);
+### &::DEBUG("_ => '$_'.") if (!defined $text);
}
} elsif (/^\s+(.*)/) {
}
}
- &main::status("Dict: wordnet: found ". scalar(@results) ." defs.");
+ &::status("Dict: wordnet: found ". scalar(@results) ." defs.");
return if (!scalar @results);
my ($socket,$query) = @_;
my @results;
- &main::status("Dict: asking Foldoc.");
+ &::status("Dict: asking Foldoc.");
print $socket "DEFINE foldoc \"$query\"\n";
my $firsttime = 1;
$string .= $_." ";
}
- &main::status("Dict: foldoc: found ". scalar(@results) ." defs.");
+ &::status("Dict: foldoc: found ". scalar(@results) ." defs.");
return if (!scalar @results);
pop @results; # last def is date of entry.