projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added information on registration, login scripts and passwords to the
[spider.git]
/
perl
/
DXUtil.pm
diff --git
a/perl/DXUtil.pm
b/perl/DXUtil.pm
index 2c814ea33d834cbe5001eede20eecc0755059695..4246754832f4eb80fe99f7e5a77944e31b32844d 100644
(file)
--- a/
perl/DXUtil.pm
+++ b/
perl/DXUtil.pm
@@
-10,6
+10,7
@@
package DXUtil;
use Date::Parse;
use IO::File;
use Date::Parse;
use IO::File;
+use File::Copy;
use Data::Dumper;
use strict;
use Data::Dumper;
use strict;
@@
-26,6
+27,7
@@
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf
parray parraypairs phex shellregex readfilestr writefilestr
@ISA = qw(Exporter);
@EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf
parray parraypairs phex shellregex readfilestr writefilestr
+ filecopy
print_all_fields cltounix unpad is_callsign is_latlong
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
);
print_all_fields cltounix unpad is_callsign is_latlong
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
);
@@
-321,6
+323,11
@@
sub writefilestr
}
}
}
}
+sub filecopy
+{
+ copy(@_) or return $!;
+}
+
# remove leading and trailing spaces from an input string
sub unpad
{
# remove leading and trailing spaces from an input string
sub unpad
{
@@
-333,7
+340,7
@@
sub unpad
# check that a field only has callsign characters in it
sub is_callsign
{
# check that a field only has callsign characters in it
sub is_callsign
{
- return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]\d+)[A-Z]
+(?:-\d{1,2}|\/[A-Z0-9]+
)?$/;
+ return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]\d+)[A-Z]
{1,3}(?:-\d{1,2}|\/(?:[A-Z]{1,2}\d{0,2}|\d[A-Z]\d{0,2})
)?$/;
}
# check that a PC protocol field is valid text
}
# check that a PC protocol field is valid text
@@
-351,7
+358,7
@@
sub is_pcflag
# check that a thing is a frequency
sub is_freq
{
# check that a thing is a frequency
sub is_freq
{
- return $_[0] =~ /^
[\d\.]+
$/;
+ return $_[0] =~ /^
\d+(?:\.\d+)?
$/;
}
# check that a thing is just digits
}
# check that a thing is just digits