more useful options | |
PerlMonks |
Re^2: why is my for loop using modulo giving me a weird outputby perlynewby (Scribe) |
on Jun 28, 2015 at 07:06 UTC ( [id://1132343]=note: print w/replies, xml ) | Need Help?? |
first, I tried with five just to check out how modulo worked nothing to do with even number yet. this is a incremental test code for me to learn perl code I expected the output to look like this: 1 2 3 4 this is because as I go thru the for loop, I goes thru 1,2,3,4,5,6,7,8,9,10,...,15,...20 but the for loop returns "0" 1 2 3 4( not as expected with "0") then it gives me the same output another 4 times. I don't understand the output being given 4 times. sorry for not being clearer perhaps this helps explain my question on iteration
In Section
Seekers of Perl Wisdom
|
|