# with dups my @inner_keys = map { keys %$_ } values %hash; # without dups my @uniq_inner_keys = do { my %inner_keys; while ( my ( undef, $href ) = each %hash ) { @inner_keys{ keys %$href } = (); } keys %inner_keys; };