From 77f4f8ef18caeb6cc96f114cc9a000bc72e19d1b Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 9 Sep 2001 16:38:26 +0000 Subject: [PATCH] fix is_freq check --- cmd/dx.pl | 4 ++-- perl/DXUtil.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 2.34.1