Well what I am trying to do is pretty simple
What i want is say I have three varibles
$X $Y1 and $Y2
I want $X to equal either $Y1 or $Y2 randomly
what I tried to do was something like this
$X = 1 + int(rand(2));
$Y1 = 1;
$Y1 = "hello"
$Y2 = 2;
$Y2 = "goodbye";
Then I want the program to pring out the text that Y1 or Y2 equals but i am not sure how to make them equal to a intager and text
Like say if X = 1 it will print out hello if X = 2 I want it to print out goodbye
How would I go about doing this?
Oh also another thing I thought of that would have the same results just a different outcome
Is if i create a database with mysql with one table with two rows one column that first row is "hello" , second row is "goodbye"
How could i acces that in perl and print out at random the text in either row?
What i want is say I have three varibles
$X $Y1 and $Y2
I want $X to equal either $Y1 or $Y2 randomly
what I tried to do was something like this
$X = 1 + int(rand(2));
$Y1 = 1;
$Y1 = "hello"
$Y2 = 2;
$Y2 = "goodbye";
Then I want the program to pring out the text that Y1 or Y2 equals but i am not sure how to make them equal to a intager and text
Like say if X = 1 it will print out hello if X = 2 I want it to print out goodbye
How would I go about doing this?
Oh also another thing I thought of that would have the same results just a different outcome
Is if i create a database with mysql with one table with two rows one column that first row is "hello" , second row is "goodbye"
How could i acces that in perl and print out at random the text in either row?