for my $num ( 0 .. 101 ) { $num += 0.0005; my $result = sprintf "%.3f", $num; print "$result\n"; }