in reply to Need help with complex hash of hashes.

:) That is a great first draft, you've got code, some warnings ... now narrow down the question until you have 20 lines of code

  • Comment on Re: Need help with complex hash of hashes.

Replies are listed 'Best First'.
Re^2: Need help with complex hash of hashes.
by vlturner (Sexton) on Jan 27, 2016 at 14:14 UTC

    This is the section I need to properly build out the HoH correctly. You can see it isn't working since VAR50 and VAR52 have the same description. It would be better if the CI was the key too.

    if ( $data[$class_pos] eq "cmdb_ci_appl" ) { my @ci_record = { description => $data[$ci_pos], name => +$data[$name_pos] }; push(@$arx_data_ref, @ci_record); print Dumper( @$arx_data_ref ) ; } if ( $data[$application_pos] ne "" && $data[$ip_address_pos] n +e "" ) { my @member = { description => $data[$application_pos], mem +ber => $data[$ip_address_pos] }; push(@$arx_data_ref, @member); print Dumper( @$arx_data_ref ) ; } $VAR49 = { 'name' => 'WINS', 'description' => 'CI10183028' }; $VAR50 = { 'description' => 'CI10199533', 'member' => '10.71.193.110' }; $VAR51 = { 'member' => '10.100.16.214', 'description' => 'CI10208139' }; $VAR52 = { 'member' => '10.100.32.156', 'description' => 'CI10199533' };
Re^2: Need help with complex hash of hashes.
by vlturner (Sexton) on Jan 27, 2016 at 13:34 UTC

    See this message for your 20 lines, that was asked first. http://www.perlmonks.org/?node_id=1153574