projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add CTY-1912 changes
[spider.git]
/
perl
/
DXUtil.pm
diff --git
a/perl/DXUtil.pm
b/perl/DXUtil.pm
index b329f51bd7d62e1b3c2de5c4c5b6f6831153a6c1..512c30efcc0e35609c3d931f0c20bf172af517ef 100644
(file)
--- a/
perl/DXUtil.pm
+++ b/
perl/DXUtil.pm
@@
-3,7
+3,7
@@
#
# Copyright (c) 1998 - Dirk Koopman G1TLH
#
#
# Copyright (c) 1998 - Dirk Koopman G1TLH
#
-#
$Id$
+#
#
package DXUtil;
#
package DXUtil;
@@
-15,18
+15,12
@@
use Data::Dumper;
use strict;
use strict;
-use vars qw($VERSION $BRANCH);
-$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
-$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
-
use vars qw(@month %patmap @ISA @EXPORT);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf
use vars qw(@month %patmap @ISA @EXPORT);
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf
- parray parraypairs phex shellregex readfilestr writefilestr
+ parray parraypairs phex
phash
shellregex readfilestr writefilestr
filecopy ptimelist
print_all_fields cltounix unpad is_callsign is_latlong
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
filecopy ptimelist
print_all_fields cltounix unpad is_callsign is_latlong
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
@@
-200,7
+194,7
@@
sub parraypairs
my $ref = shift;
my $i;
my $out;
my $ref = shift;
my $i;
my $out;
-
+
for ($i = 0; $i < @$ref; $i += 2) {
my $r1 = @$ref[$i];
my $r2 = @$ref[$i+1];
for ($i = 0; $i < @$ref; $i += 2) {
my $r1 = @$ref[$i];
my $r2 = @$ref[$i+1];
@@
-211,6
+205,20
@@
sub parraypairs
return $out;
}
return $out;
}
+# take the arg as a hash reference and print it out as such
+sub phash
+{
+ my $ref = shift;
+ my $out;
+
+ while (my ($k,$v) = each %$ref) {
+ $out .= "${k}=>$v, ";
+ }
+ chop $out; # remove last space
+ chop $out; # remove last comma
+ return $out;
+}
+
sub _sort_fields
{
my $ref = shift;
sub _sort_fields
{
my $ref = shift;
@@
-440,3
+448,4
@@
sub deleteitem
@$list = grep {$_ ne $item } @$list;
return $n - @$list;
}
@$list = grep {$_ ne $item } @$list;
return $n - @$list;
}
+