my $no_zsi;
+use strict;
+
BEGIN {
$no_zsi = 0;
eval "use LWP::UserAgent";
my ($query) = @_;
if ($no_zsi) {
- &main::status("zsi module requires LWP::UserAgent.");
+ &::status("zsi module requires LWP::UserAgent.");
return '';
}
my $res_return = 5;
my $ua = new LWP::UserAgent;
- $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy"));
+ $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam('httpProxy'));
$ua->timeout(10);
}
my $request = new HTTP::Request('GET', "$searchpath");
- my $response = $ua->request($request);
+ my $response = $ua->request($request);
if (!$response->is_success) {
return "Something failed in connecting to the ZSI web server. Try again later.";
my $content = $response->content;
if ($content =~ /No entries found/im) {
- return "$result No results were found searching ZSI for '$query'.";
+ return "No results were found searching ZSI for '$query'.";
}
my $res_count = 0; #local counter
my @lines = split(/\n/,$content);
my $result = '';
- foreach $line(@lines) {
+ foreach my $line (@lines) {
if (length($line) > 10) {
my ($name, $href, $desc) = split(/\|/,$line);
sub query {
my ($args) = @_;
&::performStrictReply(&queryText($args));
- return;
+ return;
}
1;
-# vim: shiftwidth=2 tabstop=2
+
+# vim:ts=4:sw=4:expandtab:tw=80
+
__END__