that caches the results of calls to is_prime to avoid calling it more than once with the same input. It trades off memory in an attempt to speed up the process.@primes = grep { is_prime($_) } @numbers;
In reply to Re: Unable to Understand grep and hash use for prime no.
by ikegami
in thread Unable to Understand grep and hash use for prime no.
by shankonit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |