in reply to Re^2: why is my for loop using modulo giving me a weird output
in thread why is my for loop using modulo giving me a weird output

Please read Corion again!

Is there difference between printing, what modulo operator returns and using it to test?

i.e

print 4%2; # or if (4%2 == 0) { # blah..blah... }
Is there a difference?

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Replies are listed 'Best First'.
Re^4: why is my for loop using modulo giving me a weird output
by perlynewby (Scribe) on Jun 28, 2015 at 08:22 UTC

    print, you are performing the task print

    while when you use IF then you are checking to see if the statement is true or false, If true then go and do what's inside the brackets. False, then don't go inside the brackets