removed password from login on client
[spider.git] / perl / DXUtil.pm
index d7ca5ed218e2b6e8e1671091e9c2cb043a3bf4c8..caaa38008b18928ad4435612ed84357ce67b965b 100644 (file)
@@ -191,9 +191,9 @@ sub shellregex
 # start an attempt at determining whether this string might be a callsign
 sub iscallsign
 {
-       my $call = shift;
-       return 1 if $call =~ /^\w+\d+/;
-       return 1 if $call =~ /^\d+\w+/;
+       my $call = uc shift;
+       return 1 if $call =~ /^[A-Z]+\d+[A-Z]+/;
+       return 1 if $call =~ /^\d+[A-Z]\d+[A-Z]+/;
        return undef;
 }
 
@@ -268,11 +268,13 @@ sub writefilestr
        }
 
        my $fh = new IO::File ">$fn";
-       my $dd = new Data::Dumper([ $obj ]);
-       $dd->Indent(1);
-       $dd->Terse(1);
-    $dd->Quotekeys(0);
-#      $fh->print(@_) if @_ > 0;     # any header comments, lines etc
-       $fh->print($dd->Dumpxs);
-       $fh->close;
+       if ($fh) {
+               my $dd = new Data::Dumper([ $obj ]);
+               $dd->Indent(1);
+               $dd->Terse(1);
+               $dd->Quotekeys(0);
+               #       $fh->print(@_) if @_ > 0;     # any header comments, lines etc
+               $fh->print($dd->Dumpxs);
+               $fh->close;
+       }
 }