laziness, impatience, and hubris | |
PerlMonks |
Re^2: Stupidest Prime Number detector ever!! (updated)by AnomalousMonk (Archbishop) |
on Jun 23, 2021 at 23:27 UTC ( [id://11134228]=note: print w/replies, xml ) | Need Help?? |
Some comments on the is_lousy_prime() function code.
The exit; statement in the code above will never be reached. No code in the function will be executed after the return 0; statement executes. There's another example of this unreachable-code syntax in the foreach loop further on in the function.
This is more involved, but essentially the same thing is happening: the exit built-in function will never be executed.
And one more thing: Please, please choose a reasonable indentation style and stick to it!
Update:
Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|