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

It's a version of
@primes = grep { is_prime($_) } @numbers;
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.