http://www.perlmonks.org?node_id=969110

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi all i wrote this function to check if the number is prime or not but i just want to confirm if i'm doing this correctly :
sub isPrime($) { $num = shift; my ($i,$c); for ($i = 1; $i < $num / 2; $i++) { if ($num % $i == 0){$c += 1;} } if ($c == 1){return 1;} return 0; }