ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/HashDB.pm
(Generate patch)

Comparing COMP/SCRAM/src/Utilities/HashDB.pm (file contents):
Revision 1.11 by sashby, Fri Jan 13 18:48:29 2006 UTC vs.
Revision 1.12 by sashby, Thu Jan 19 17:26:29 2006 UTC

# Line 167 | Line 167 | sub restore {
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 ------------

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines