7 my ($self, $line) = @_;
8 my @list = split /\s+/, $line; # split the line up
14 my ($fromday, $today);
22 while ($f = shift @list) { # next field
23 # print "f: $f list: ", join(',', @list), "\n";
25 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o; # is it a from -> to count?
26 next if $from && $to > $from;
29 ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
32 if (lc $f eq 'on' && $list[0]) { # is it freq range?
34 my @r = split '/', $list[0];
35 # print "r0: $r[0] r1: $r[1]\n";
36 my @fr = Bands::get_freq($r[0], $r[1]);
37 if (@fr) { # yup, get rid of extranous param
38 # print "freq: ", join(',', @fr), "\n";
40 push @freq, @fr; # add these to the list
44 if (lc $f eq 'day' && $list[0]) {
46 ($fromday, $today) = split '-', shift(@list);
49 if (lc $f eq 'info' && $list[0]) {
54 if ((lc $f eq 'spotter' || lc $f eq 'by') && $list[0]) {
55 # print "got spotter\n";
56 $spotter = uc shift @list;
64 # first deal with the prefix
66 $pre .= '*' unless $pre =~ /[\*\?\[]/o;
67 $pre = shellregex($pre);
68 $expr = "\$f1 =~ m{$pre}o";
70 $expr = "1"; # match anything
73 # now deal with any frequencies specified
75 $expr .= ($expr) ? " && (" : "(";
77 for ($i = 0; $i < @freq; $i += 2) {
78 $expr .= "(\$f0 >= $freq[$i] && \$f0 <= $freq[$i+1]) ||";
87 $expr .= " && " if $expr;
88 $info = shellregex($info);
89 $expr .= "\$f3 =~ m{$info}io";
94 $expr .= " && " if $expr;
95 $spotter = shellregex($spotter);
96 $expr .= "\$f4 =~ m{$spotter}o";
99 #print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n";
102 my @res = Spot::search($expr, $fromday, $today, $from, $to);
105 foreach $ref (@res) {
107 push @out, Spot::formatl(@dx);