in reply to grep keys in hash and retrieve values

If you want the list of matches, use an array:

my @matches = grep /$regex/, keys %tax2loc

This puts grep into list context, thus returning a list of all matches (and not just the number of matches).