use warnings; use strict; my $i = 0.1; my $v = 0 - $i; while ( $v < 9 ) { $v += $i; printf "%.1f%s", $v, $/; }