in reply to [Answered!] Taking a subset of a hash

Like this?
my %small_hash; my @keys_to_keep = grep $config->{$_},@interesting_keys; @small_hash{@keys_to_keep} = @$config{@keys_to_keep}; return \%small_hash;