To get $n random numbers into @list, use:

@list = (rand(4)) x $n;

~Sid


On Fri, 17 Sep 2004 15:02:55 +0200 (CEST), c r <[EMAIL PROTECTED]> wrote:
> Hi!
> 
> Is it possible to avoid another loop by using the x operator? I.e.
> 
> push(@list, rand(4));
> 
> gives me one element in @list.
> 
> Can I somehow use the x operator to produce two different elements in the @list?
> 
> 



-- 
http://www.upster.blogspot.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to