From: minima Date: Sun, 9 Sep 2001 16:38:26 +0000 (+0000) Subject: fix is_freq check X-Git-Tag: R_1_48~34 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=77f4f8ef18caeb6cc96f114cc9a000bc72e19d1b;p=spider.git fix is_freq check --- diff --git a/cmd/dx.pl b/cmd/dx.pl index a4ea8464..6e14cda5 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -33,10 +33,10 @@ if ($f[0] =~ /^by$/i) { } # get the freq and callsign either way round -if ($f[0] =~ /[A-Za-z]/) { +if (is_freq($f[1])) { $spotted = uc $f[0]; $freq = $f[1]; -} elsif ($f[0] =~ /^[0-9\.\,]+$/) { +} elsif (is_freq($f[0])) { $freq = $f[0]; $spotted = uc $f[1]; } else { diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 2c814ea3..9d475ed8 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -351,7 +351,7 @@ sub is_pcflag # check that a thing is a frequency sub is_freq { - return $_[0] =~ /^[\d\.]+$/; + return $_[0] =~ /^\d+(?:\.\d+)?$/; } # check that a thing is just digits