$totalspots = $hfspots = $vhfspots = 0;
$use_db_for_search = 0;
-our $usetac = 1;
-our $readback;
+our $readback = 0;
-if ($usetac) {
+if ($readback) {
$readback = `which tac`;
chomp $readback;
}
return $main::dbh->spot_search($hint, $dayfrom, $dayto, $to-$from, $dxchan);
}
-# $expr =~ s/\$f(\d\d?)/\$ref->[$1]/g; # swap the letter n for the correct field name
+ # $expr =~ s/\$f(\d\d?)/\$ref->[$1]/g; # swap the letter n for the correct field name
# $expr =~ s/\$f(\d)/\$spots[$1]/g; # swap the letter n for the correct field name
my @spots;
my $recs;
- for ($i = $count = 0; $count < $to && $i < $maxdays; ++$i) { # look thru $maxdays worth of files only
+ for ($i = $count = 0; $count < $to && $i < $maxdays; ++$i) { # look thru $maxdays worth of files only
last if $now->cmp($todate) <= 0;
my $fn = $fp->fn($now->sub($i));
if ($readback) {
dbg("Spot::search search using tac fn: $fn $i") if isdbg('search');
$fh = IO::File->new("$readback $fn |");
- } else {
+ }
+ else {
dbg("Spot::search search fn: $fp->{fn} $i") if isdbg('search');
- $fh = $fp->open($now->sub($i)); # get the next file
+ $fh = $fp->open($now->sub($i)); # get the next file
}
if ($fh) {
my $rec = 0;
return ("Spot search error", $@) if $@;
}
}
-
-
- return $readback ? @out : reverse @out;
+ @out = sort {$b->[2] <=> $a->[2]} @out if @out;
+ return @out;
}
# change a freq range->regular expression