167 |
|
my $filename=shift; |
168 |
|
my @arr=(); |
169 |
|
my $data; |
170 |
– |
|
170 |
|
my $fh=FileHandle->new(); |
171 |
< |
open ($fh, "<$filename") or die "Unable to open file $filename\n $!\n"; |
172 |
< |
while ( <$fh> ) { |
173 |
< |
push @{$self->{dataitems}}, Utilities::DataItem->restore($fh); |
174 |
< |
} |
171 |
> |
local *FH=$fh; |
172 |
> |
|
173 |
> |
if ($fh->open("<$filename")) |
174 |
> |
{ |
175 |
> |
# my $line; |
176 |
> |
# while ($line = $fh->getline()) |
177 |
> |
while (defined $fh) |
178 |
> |
{ |
179 |
> |
push @{$self->{dataitems}}, Utilities::DataItem->restore($fh); |
180 |
> |
} |
181 |
> |
} |
182 |
> |
|
183 |
> |
# open ($fh, "<$filename") or die "Unable to open file $filename\n $!\n"; |
184 |
> |
|
185 |
> |
#while ( <$fh> ) { |
186 |
> |
# { print "...HashDB: in while loop","\n"; |
187 |
> |
# push @{$self->{dataitems}}, Utilities::DataItem->restore($fh); |
188 |
> |
# } |
189 |
|
close $fh; |
190 |
+ |
#print "end restore","\n"; |
191 |
|
} |
192 |
|
|
193 |
|
# ------------------- Support Routines ------------ |