- or download this
$i=5; print do{ --$1 }; # prints 4
$i=5; print do{ --$i } while $i; # prints 43210
- or download this
$i=5; print --$1; # prints 4
$i=5; print --$i while $i; # prints 43210
- or download this
$i=5;
print( do{--$i;} ) while $i;
- or download this
$i=5;
do {
print --$i;
} while ($i);
- or download this
$i = 5;
while ($i) {
print --$i;
}
- or download this
my ($i, $j) = (5, 0);
$j += do {
print --$i;
} while ($i);
print $j; # prints 5.