Another way,

my @c = (1,2,3); my @d = (1,2);
print join '',$c[int rand @c],$d[int rand @d];

This could generate arbitrary random string other than the numbers of "1 2 3" 
or "1 2".
ie,the original contents could be:

my @c = qw(a,b,c);
my @d = qw(4,5,6);



>
>Hello, I need to generate two random numbers.  One should be a 1, 2,
>or 3, and the other should be a 1 or 2.  How can I do that?
>


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


Reply via email to