remove Compress::Zlib
[spider.git] / perl / USDB.pm
index 4cd4143bd3b7aca6794a188678ba8d43a3f2b2cb..14f9fc2ec49fa860b8107728a5414847d9eb5d9a 100644 (file)
@@ -13,7 +13,7 @@ use DXVars;
 use DB_File;
 use File::Copy;
 use DXDebug;
-use Compress::Zlib;
+#use Compress::Zlib;
 
 use vars qw($VERSION $BRANCH);
 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
@@ -102,11 +102,12 @@ sub load
        
        # now write away all the files
        for (@_) {
-               my $fn = shift;
-               my $f = gzopen($fn, "r") or return "Cannot open $fn $!";
-               my $l;
-               while ($f->gzreadline($l)) {
-                       chomp $l;
+               my $ofn = shift;
+               my $of = new IO::File "$ofn" or return "Cannot read $ofn $!";
+
+               while (<$of>) {
+                       my $l = $_;
+                       $l =~ s/[\r\n]+$//;
                        my ($call, $city, $state) = split /\|/, $l;
                        
                        # lookup the city 
@@ -122,7 +123,8 @@ sub load
                        }
                        $dbn{$call} = $ctyn; 
                }
-               $f->gzclose;
+               $of->close;
+               unlink $ofn;
        }
        
        untie %dbn;