in reply to Re^6: 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
re "use integer" tells Perl "to use integer arithmetic instead of floating point" (see http://perldoc.perl.org/integer.html ) -- it's a pragma whereas marinersk's reference is to the function int, which you use correctly in your second code section (tho the output would look better if you included a space before the trailing quote on the text).
UPDATE: s/correctly/ correctly assuming a value for $i greater than 5. If ($i <5) you'll get zero because int removes fractional the fractional part of a value 0.nnnn / which will look a lot like 5%5. (see -- on your own CLI -- perldoc -f int).
|
|---|