From: Sid <[EMAIL PROTECTED]>
> To get $n random numbers into @list, use:
>
> @list = (rand(4)) x $n;
>
> ~Sid
Nope. This way you get $n times the same random number. Try:
print join(', ', (rand(4)) x 5);
You need to do something like this:
@list = map rand(4), (1..$n);
or
push @list, rand(4) for (1..$n);
or
@list = map rand(4), (1) x $n;
That is you have to make sure the rand(4) is called repeatedly.
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>