- my $state = "call";
- while (my $result = $t->getline) {
-# print "$state: $result";
- if ($state eq 'call' && $result =~ /$l/i) {
- $state = 'getaddr';
- push @out, uc $l;
- } elsif ($state eq 'getaddr' || $state eq 'inaddr') {
- if ($result =~ /^\s+([\w\s.,;:-]+)(?:<br>)?$/) {
- my $line = $1;
- unless ($line =~ /^\s+$/) {
- push @out, $line;
- $state = 'inaddr' unless $state eq 'inaddr';
- }
- } else {
- $state = 'runout' if $state eq 'inaddr';
- }
+ my $state = "blank";
+ while (my $result = eval { $t->getline(Timeout => 30) } || $@) {
+ dbg($result) if isdbg('qrz') && $result;
+ if ($@) {
+ push @out, $self->msg('e18', 'QRZ.com');
+ last;
+ }
+ if ($state eq 'blank' && $result =~ /^\s*Callsign\s*:/i) {
+ $state = 'go';
+ } elsif ($state eq 'go') {
+ next if $result =~ /^\s*Usage\s*:/i;
+ chomp $result;
+ push @out, $result;