did some work on the cluster database related things
[spider.git] / perl / Spot.pm
index 167671ddab31f169db4edbbb0f90b1c53aec6a9a..08520c5b47f1108ec26d33d7195372d089cb0dca 100644 (file)
@@ -18,12 +18,13 @@ use Carp;
 @ISA = qw(Julian);
 
 use strict;
+use vars qw($fp $maxspots $defaultspots $maxdays $dirprefix);
 
-my $fp;
-my $maxspots = 50;      # maximum spots to return
-my $defaultspots = 10;    # normal number of spots to return
-my $maxdays = 35;        # normal maximum no of days to go back
-my $dirprefix = "$main::data/spots";
+$fp = undef;
+$maxspots = 50;      # maximum spots to return
+$defaultspots = 10;    # normal number of spots to return
+$maxdays = 35;        # normal maximum no of days to go back
+$dirprefix = "$main::data/spots";
 
 sub prefix
 {
@@ -109,14 +110,9 @@ sub search
        $to = $defaultspots;
   }
 
-  $expr =~ s/\$f(\d)/zzzref->[$1]/g;               # swap the letter n for the correct field name
-  $expr =~ s/[\@\$\%\{\}]//g;                           # remove any other funny characters
-  $expr =~ s/\&\w+\(//g;                           # remove subroutine calls
-  $expr =~ s/eval//g;                              # remove eval words
-  $expr =~ s/zzzref/\$ref/g;                       # put back the $ref
-  $expr =~ s|(/.+/)|$1oi|g;                        # add oi characters to /ccc/
+  $expr =~ s/\$f(\d)/\$ref->[$1]/g;               # swap the letter n for the correct field name
   
-  print "expr=($expr), from=$from, to=$to\n";
+  dbg("search", "expr='$expr', spotno=$from-$to, day=$dayfrom-$dayto\n");
   
   # build up eval to execute
   $eval = qq(my \$c;