in reply to Loop through hash structure
You can use the following code for getting the values of hash.
for my $record ( $hash{'Application'}) { print "Environment:".$record->{'Environment'}[0]->{'Name'} ."\n"; print "Region:".$record->{'Environment'}[0]->{'Region'}[0]->{'Name'}." +\n"; print "Idrive:".$record->{'Environment'}[0]->{'Region'}[0]->{'Idrive'} +."\n"; print "LPad:".$record->{'Environment'}[0]->{'Region'}[0]->{'Zdrive'}." +\n"; }
For your reference, I have used the index as 0.You can find the length of the array in the hash and you can loop through the array length.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Loop through hash structure
by PerlScholar (Acolyte) on Sep 07, 2010 at 11:43 UTC | |
by Corion (Patriarch) on Sep 07, 2010 at 13:21 UTC | |
by PerlScholar (Acolyte) on Sep 08, 2010 at 13:14 UTC | |
by Corion (Patriarch) on Sep 08, 2010 at 13:22 UTC |
In Section
Seekers of Perl Wisdom