the last line of the code I am stumped on. I want it to start a new line after five numbers. It works if the number range is smaller than 10 numbers, however if I expand past 10 numbers it keeps on trucking.#!/usr/bin/perl -w use strict; my $num1; my $num2; print "Enter in a whole number: "; chomp ($num1 = <STDIN>); print "Enter in another whole number: "; chomp ($num2 = <STDIN>); print "\n"; foreach ( $num1 .. $num2 ) { print "$_ "; print "\n" if ( $_ == ($num1 +4) ); }
In reply to Re^2: Chess Board Single Loop
by xantithor
in thread Chess Board Single Loop
by xantithor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |