in reply to Re: What is the best way to find the key is exists or not in a hash ?
in thread What is the best way to find the key is exists or not in a hash ?

Given the necessary modification to exists_ggg:

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

Just in case anyone had any doubts regarding the efficency of exists alternatives:

Rate exists_ggg exists_srk exists exists_ggg 5394/s -- -68% -98% exists_srk 16784/s 211% -- -92% exists 219707/s 3973% 1209% --

If you're really worried about that 219707-th of a second, you've got bigger problems...