Hi,
I built a HoH as follows:
# build hash
while() {
...
$hshFoo{$key1}{$key2} = $strFileName;
...
# key1 is a number
# key2 is a sequential number
}
The entries are placed in seqential order
such as:
$hshFoo{2823}{0} = 2823_0.xml
$hshFoo{2823}{1} = 2823_1.xml
$hshFoo{2823}{2} = 2823_2.xml
$hshFoo{2823}{3} = 2823_3.xml
When I dump the hash, the keys come out
as follows:
foreach $key1 (keys %hshFoo) {
foreach $key2 (keys %{$hshFoo{$key1}}) {
print "$key1/$key2 => $hshFoo{$key1}{$key2}\n";
}
}
...
Output:
2823/1 => 2823_1.xml
2823/0 => 2823_0.xml
2823/3 => 2823_3.xml
2823/2 => 2823_2.xml
...
I expected:
2823/0 => 2823_0.xml
2823/1 => 2823_1.xml
2823/2 => 2823_2.xml
2823/3 => 2823_3.xml
The files were originally placed in the hash
from a sorted array. Are the keys not in order
within the hash or does Perl just grab the
keys in any order?
Just curious. :)
-P0w3rK!d