X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FUSDB.pm;h=14f9fc2ec49fa860b8107728a5414847d9eb5d9a;hb=bbed459bfb3fdba0379fed67c324539338c84d0e;hp=4cd4143bd3b7aca6794a188678ba8d43a3f2b2cb;hpb=cdc4f242667e4df3b2923fde3b888759b1256510;p=spider.git diff --git a/perl/USDB.pm b/perl/USDB.pm index 4cd4143b..14f9fc2e 100644 --- a/perl/USDB.pm +++ b/perl/USDB.pm @@ -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;