in reply to Checking for odd/even number

Both perlmonkey's and AM's comments are right on the money, but I figured a futher explaination may be warranted.

perl's % operator is the "modulus" (aka "mod") operator -- in other words, it gives you an integer representation of the remainder of a division operation.

If X / Y divides evenly (that is to say, there's no remainder (or modulus)), the result of X % Y will be zero.