"be consistent" | |
PerlMonks |
Re: for loop less than test ill behaved...by haj (Vicar) |
on Mar 30, 2020 at 15:37 UTC ( [id://11114810]=note: print w/replies, xml ) | Need Help?? |
The rand function returns a fractional number, but you just print the integer part with the %d format. In the last iteration $k is still less than $data_length which you'll see easily if you print using the %fformat, or just use print instead of printf.
In Section
Seekers of Perl Wisdom
|
|