From c0061eedd6e656543667cf2d204340975eea1ecc Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 13 Oct 2002 23:41:02 +0000 Subject: [PATCH] Working? --- perl/USDB.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/perl/USDB.pm b/perl/USDB.pm index 3ee18825..c12247a3 100644 --- a/perl/USDB.pm +++ b/perl/USDB.pm @@ -105,16 +105,18 @@ sub load 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 $of = new IO::File "+>$ofn" or return "Cannot read $ofn $!"; my ($l, $buf); while ($l = $if->gzread($buf)) { $of->write($buf, $l); } $if->gzclose; - $of->seek(0, 0); + $of->close; + $of = new IO::File "$ofn" or return "Cannot read $ofn $!"; - while ($of->getline()) { - chomp $l; + while (<$of>) { + $l = $_; + $l =~ s/[\r\n]+$//; my ($call, $city, $state) = split /\|/, $l; # lookup the city -- 2.43.0