projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ddd211
)
Working?
author
minima
<minima>
Sun, 13 Oct 2002 23:41:02 +0000
(23:41 +0000)
committer
minima
<minima>
Sun, 13 Oct 2002 23:41:02 +0000
(23:41 +0000)
perl/USDB.pm
patch
|
blob
|
history
diff --git
a/perl/USDB.pm
b/perl/USDB.pm
index 3ee18825d04b89754a8d2c1a8559f3768fe58857..c12247a34503b2ce47e3d93dc0251e669726dda9 100644
(file)
--- 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 $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;
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
my ($call, $city, $state) = split /\|/, $l;
# lookup the city