put duplicate checking into respective modules and out of DXProt.
[spider.git] / perl / DXUtil.pm
index 7be97ebf17a1972afb6c0c117c11c0ac91ebdc9a..aad4696565e1a9e8a709572b8467432b9fa7d011 100644 (file)
@@ -16,7 +16,7 @@ require Exporter;
 @ISA = qw(Exporter);
 @EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf 
                         parray parraypairs shellregex readfilestr writefilestr
-             print_all_fields cltounix iscallsign
+             print_all_fields cltounix iscallsign unpad
             );
 
 @month = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
@@ -279,3 +279,16 @@ sub writefilestr
                $fh->close;
        }
 }
+
+# remove leading and trailing spaces from an input string
+sub unpad
+{
+       my $s = shift;
+       $s =~ s/^\s+|\s+$//;
+       return $s;
+}
+
+
+
+
+