| Iterate through Hash of Hashes |
|
|
| Perl |
|
Create a hash first:
#!/usr/bin/perl Then iterate through it:
foreach my $family (keys %HoH) { Other operationsInsert another set of values:
$HoH{ mash } = { Access particular value:
print $HoH{flintstones}{wife}; # will output "wilma" Set value of a particular key:
$HoH{$flintstones}->{wife} = "jane"; #give Fred a new wife
|
| Last Updated on Thursday, 22 December 2011 08:25 |


Here's how you would iterate through multidimensional hashes in Perl: