There's more than one way to do things | |
PerlMonks |
Re: Unable to Understand grep and hash use for prime no.by vinoth.ree (Monsignor) |
on Aug 04, 2015 at 04:48 UTC ( [id://1137331]=note: print w/replies, xml ) | Need Help?? |
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...
In Section
Seekers of Perl Wisdom
|
|