I'm unable to understand what exactly this code doing: exists $is_prime{$_} and $is_prime{$_}
my %is_prime; @primes = grep { ( exists $is_prime{$_} and $is_prime{$_} ) or ( $is_prime{$_} = is_prime($_) ) } @numbers;
I appreciate your time to read and answer and thank u in advance. :)
In reply to Unable to Understand grep and hash use for prime no. by shankonit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |