in reply to Re: Looping through an Array of Hashes
in thread Looping through an Array of Hashes
#!/usr/bin/perl use strict; use warnings; my %hash1 = ("a" => "Apple", "b" => "Ball"); my %hash2 = ("c" => "Cat", "d" => "Dog"); my @myarray; push @myarray, \%hash1; push @myarray, \%hash2; foreach my $value (@myarray) { foreach my $hvalue (keys %{$value}) { print $hvalue . "\t"; print $value->{$hvalue} . "\n"; } }
|
|---|