#variables used in the example
$lower = 0; # lowest temperature
$upper = 300; # highest temperature
$step = 20; # increment step
# a simple while structure
$fahr = $lower;
while ($fahr <= $upper) {
$celsius = 5/9 * ($fahr-32);
print "$fahr $celsius\n";
$fahr = $fahr + $step;
}
# a simple until structure
$fahr = $lower;
until ($fahr > $upper) {
$celsius = 5/9 * ($fahr-32);
print "$fahr $celsius\n";
$fahr = $fahr + $step;
}
This page is maintained by Al Bento who can be reached at abento@ubmail.ubalt.edu. This page was last updated on February 15, 2001. Although we will attempt to keep this information accurate, we can not guarantee the accuracy of the information provided.