You say you have verified that the hash contains all 40 elements. How? Without seeing that code it is going to be hard for us to guess why print_hash() only prints out 11 elements, but your mystery method prints out 40.
That aside, you might want to consider the following changes:
while (my $line=<MYFILE>) { chomp $line; #set up hash entry }
my $buildings={}; #set up a hash reference while (my $line = <MYFILE>) { #... parse line $buildings->{$bldg_name}{'name'} = $bldg_name; $buildings->{$bldg_name}{'number'} = $vlan_number; #... and so on } # ... more stuff print_hash($buildings);
Best, beth
In reply to Re: Printing of Array Hash is Missing Elements
by ELISHEVA
in thread Printing of Array Hash is Missing Elements
by spickles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |