in reply to for loop with float

Answering the question as asked, the answer is yes:
#!/usr/bin/perl use warnings; use strict; for (my $i = 0 ; $i < 9 ; $i = sprintf("%.1f", $i + 0.1)) { print "$i\n"; }

Although ikegami's answer is probably what you want.