X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FUSDB.pm;h=d5ac1d8a59cd2a5ea5fe90e77d60eea13965bd3f;hb=4b66b2a1eb8b919480eb87827a7215fcb359b7d0;hp=3ee18825d04b89754a8d2c1a8559f3768fe58857;hpb=1ddd21105b4fdf68756a8676a58105927254d386;p=spider.git diff --git a/perl/USDB.pm b/perl/USDB.pm index 3ee18825..d5ac1d8a 100644 --- a/perl/USDB.pm +++ b/perl/USDB.pm @@ -102,19 +102,12 @@ sub load # now write away all the files for (@_) { - my $fn = shift; - my $if = gzopen($fn, "r") or return "Cannot open $fn $!"; - my $ofn = "$fn.upk"; - my $of = new IO::File "+>$ofn" or return "Cannot open $ofn $!"; - my ($l, $buf); - while ($l = $if->gzread($buf)) { - $of->write($buf, $l); - } - $if->gzclose; - $of->seek(0, 0); + my $ofn = shift; + my $of = new IO::File "$ofn" or return "Cannot read $ofn $!"; - while ($of->getline()) { - chomp $l; + while (<$of>) { + my $l = $_; + $l =~ s/[\r\n]+$//; my ($call, $city, $state) = split /\|/, $l; # lookup the city