my %hash = (tom => 23, larry=> 't0', tina=> 23); my @filteredhash = grep{/^t/} keys %hash; my %newhash = map{$_, $hash{$_}} @filteredhash; #### my %newhash = map{$_, $hash{$_}} grep{/^t/} keys %hash;