sub exists_ggg (\%;$) { my($h,$k) = @_; my $c; grep { length == length $k } grep { /\Q$k\E/ } grep { ++$c % 2 } %$h; }