To me the advantage of:
if ($y % 3 == 0) { }
is that you are explicitly stating that you are testing for a modulus being zero.
With:
unless ($y % 3) { }
you are saying you are interested in Perl's idea of the statement's truth/falsehood - which is a subtly different concept.
In reply to Re^4: mod function
by adrianh
in thread mod function
by bdawg613
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |