@divisors = grep { $number % $_ == 0 } 1 .. sqrt($number);
I think you are thinking of prime factorization here. You can stop there to determine primeness but not to determine all factors.
Cheers - L~R
In reply to Re^2: Finding all divisors of an integer
by Limbic~Region
in thread Finding all divisors of an integer
by chiburashka
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |