You are comparing $number2 and $number1 in your while; neither ever changes. That's why you get an infinite loop. Here is a solution that preserves the value in $number1.
my $number1 = 1; my $number2 = 10; my $i = $number1; while ($number2 >= $i) { print $i++,"\n"; }
In reply to Re^5: SIMPLE way to write these?
by GotToBTru
in thread SIMPLE way to write these?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |