X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FSpot.pm;h=d663c9bd3e973a82e1a9b55637ab96255c4d1a49;hb=3b52d4a1eb273c6e6eff14223baf69c0a309899c;hp=75e34c116a7e7e2f11bb21047637eb37dc01ba63;hpb=c36b11f5bda0555f5ff58e0499c77652b5d0f6ca;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index 75e34c11..d663c9bd 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -8,7 +8,7 @@ package Spot; -use FileHandle; +use IO::File; use DXVars; use DXDebug; use DXUtil; @@ -29,7 +29,7 @@ $dirprefix = "spots"; sub init { mkdir "$dirprefix", 0777 if !-e "$dirprefix"; - $fp = DXLog::new($dirprefix, "dat", 'd') + $fp = DXLog::new($dirprefix, "dat", 'd'); } sub prefix @@ -105,7 +105,7 @@ sub search my $ref; my $i; my $count; - my @today = Julian::unixtoj(time); + my @today = Julian::unixtoj(time()); my @fromdate; my @todate; @@ -140,7 +140,7 @@ sub search $fp->close; # close any open files - for ($i = 0; $i < $maxdays; ++$i) { # look thru $maxdays worth of files only + for ($i = $count = 0; $i < $maxdays; ++$i) { # look thru $maxdays worth of files only my @now = Julian::sub(@fromdate, $i); # but you can pick which $maxdays worth last if Julian::cmp(@now, @todate) <= 0;