in reply to dynamically generated array variable
The following works, with some modification to your original array:
use strict; use warnings; my @host1 =( {"a" => 1, "b" => "two" }, {"a" => 3, "b" => "four"} ); foreach my $hash (@host1) { print "a = " . ${$hash}{"a"} . ", b = " . ${$hash}{"b"} . "\n"; }
|
---|
In Section
Seekers of Perl Wisdom