X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FGeomag.pm;h=8b0d2ea7f4cd0933757ed90f6ac68d174ca9bd3b;hb=f3adc82a0299652d929b73c718127fa38571eec5;hp=1a118fe07a869d5d60efb020556bda7180928092;hpb=69003f56e5249357c746999c2feec5f44c258472;p=spider.git diff --git a/perl/Geomag.pm b/perl/Geomag.pm index 1a118fe0..8b0d2ea7 100644 --- a/perl/Geomag.pm +++ b/perl/Geomag.pm @@ -140,7 +140,7 @@ sub forecast # # This command outputs a list of n lines starting from line $from to $to # -sub print +sub search { my $from = shift; my $to = shift; @@ -160,7 +160,7 @@ sub print if ($search) { \$count++; next if \$count < \$from; - push \@out, print_item(\$ref); + push \@out, \$ref; last if \$count >= \$to; # stop after n } } @@ -169,8 +169,7 @@ sub print $fp->close; # close any open files my $fh = $fp->open(@date); -LOOP: - while ($count < $to) { + for ($count = 0; $count < $to; ) { my @in = (); if ($fh) { while (<$fh>) { @@ -178,7 +177,7 @@ LOOP: push @in, [ split '\^' ] if length > 2; } eval $eval; # do the search on this file - return ("Spot search error", $@) if $@; + return ("Geomag search error", $@) if $@; last if $count >= $to; # stop after n } $fh = $fp->openprev(); # get the next file