in reply to Unable to Understand grep and hash use for prime no.
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;
|
|---|