Hi, I'm quite new to perl programming. Here's the problem: I can't get my loop to generate more than 3 random numbers, and I can't figure out why. The command line arguments provide the amount of numbers I want, the minimum and maximum of those values. Here's the important part of code I used:
$n=$ARGV[0]; $a=$ARGV[1]; $b=$ARGV[2]; my $range = $b-$a; for ($i=0,$i<=$n,$i++){ $random_number= int((rand($range)) + $a); print $random_number."\n"; push (@numbers, $random_number); }
appreciate the help!
In reply to for loop by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |