$VAR1 = {
'10.1.7.142' => {
'counter' => 2,
'clusterstatus' => on,
},
'10.1.7.11' => {
'counter' => 3,
'clusterstatus' => off,
},
'10.1.7.112' => {
'counter' => 3,
'clusterstatus' => on,
},
};
####
[% FOREACH ip = data %]
this is ip [% ip %] counter is [% ip.counter %]
[% END %]
####
this is ip is HASH(0x9c68328) counter is
this is ip is HASH(0x9c62e68) counter is
this is ip is HASH(0x9c62d0c) counter is
####
in the same object:
'ips' => [
'10.1.7.142',
'10.1.7.11',
'10.1.7.112'
],
####
[% FOREACH ip in ips %]
this is ip is [% ip %] counter is [% ip.counter %]
[% END %]