comp1-cmd1-test1 comp1-cmd1-test2 comp1-cmd2-test1 comp2-cmd1-test1 comp2-cmd1-test2 comp3-cmd1-test1 #### %hoh = ( "comp1" => { "cmd1" => [ "test1", "test2" ], "cmd2" => [ "test1" ] }, "comp2" => { "cmd1" => [ "test1", "test2" ] }, "comp3" => { "cmd1" => [ "test1" ] }, );
##
## %hoh = (); foreach my $temp (sort @{$arr1} ) { my ($comp, $cmd, $test) = split(/\-/, $temp); $hoh{$temp} = { comp => $comp, cmd => $cmd, test => $test, }; }