# Iterate over the configuration types listed in @type_order foreach my $type (@type_order) { print "$log_pre running $action for $type entries\n"; # Iterate over all items of that type my $type_hash = $hashref->{$type}; #shortcut to smaller hash foreach my $item (keys %{$type_hash}) { print "$log_pre running $action for $type $item\n"; die "$type doesn't exist in %{\$hashref}" or isnt a hash ref unless exists $hashref->{$type} && ref $hashref->{$type} eq 'HASH'; my $item_hash = $type_hash->{$item}; #shortcut to smaller hash #Add values for type and action into the hash $item_hash->{'name'} = $item; $item_hash->{'type'} = $type; $item_hash->{'action'} = $action; #print Dumper($item_hash); #execute action for the individual configuration unless (db2_mgmt_cat(\%{$item_hash})) {