in reply to Re^2: while loops with two tests not working.
in thread while loops with two tests not working.

Why do you test $i > 0 - it will always fail on the first iteration and you never get another. More likely the logic of what you want is:

use strict; use warnings; for my $avg (0, 1.3, 1.5, 1.6, 3, 5) { my $average = $avg; my $stars = 0; print "$average: "; while ($stars < int ($average)) { print "*"; ++$stars; } if ($stars <= $average - 0.5) { print "+"; ++$stars; } while ($stars < 5) { print "."; $stars++; } } continue { print "\n"; }

DWIM is Perl's answer to Gödel