in reply to Unable to Understand grep and hash use for prime no.

what you did not understand from the above code ?

Don't you know exists $is_prime{$_} part checks whether a key exists in a hash or not.

Don't you know $is_prime{$_} checks a value with the key in hash is true.(assuming your is_prime() function Boolean value(True or False))


All is well. I learn by answering your questions...