in reply to Re^4: Need help with complex hash of hashes.
in thread Need help with complex hash of hashes.
After parsing the XML into something sane (see my previous comment), the next step is to build the hash you want:
my %applications; for my $item (@items) { if ($item->{sys_class_name} eq 'cmdb_ci_appl') { $applications{$item->{u_ci_id}}{name} = $item->{name} } else # assume device { push @{$applications{$item->{u_application_id}}->{member}}, $item->{ip_address} if $item->{ip_address} } }
This code has minimal consistency checks. Making it fully robust is left as an exercise for the reader.
|
|---|