projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove Compress::Zlib
[spider.git]
/
perl
/
USDB.pm
diff --git
a/perl/USDB.pm
b/perl/USDB.pm
index 4cd4143bd3b7aca6794a188678ba8d43a3f2b2cb..14f9fc2ec49fa860b8107728a5414847d9eb5d9a 100644
(file)
--- a/
perl/USDB.pm
+++ b/
perl/USDB.pm
@@
-13,7
+13,7
@@
use DXVars;
use DB_File;
use File::Copy;
use DXDebug;
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+)/ );
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 (@_) {
# 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
my ($call, $city, $state) = split /\|/, $l;
# lookup the city
@@
-122,7
+123,8
@@
sub load
}
$dbn{$call} = $ctyn;
}
}
$dbn{$call} = $ctyn;
}
- $f->gzclose;
+ $of->close;
+ unlink $ofn;
}
untie %dbn;
}
untie %dbn;