foreach my $name(keys %input) { if ($input{$name}[1] eq $chr) {