in reply to HoH problem
In each iteration of that loop, the value of the hash element "$data{$file}" is being replaced by a new anonymous hash, containing a just single "$ID, $name" tuple -- and the previous "$ID, name" are discarded. Don't you want the HoH to have a more than one key in the second-layer hash? I would have expected something like this:while (<open>) { ($name, $ID) = (split)...; $data{$file} = {$ID => $name}; }
while (<open>) { ($name, $ID) = (split)...; $data{$file}{$ID} = $name; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HoH problem
by Anonymous Monk on Nov 08, 2006 at 09:26 UTC |