print "$letters[int rand @letters]\t"; } print "\n"; print "Are you happy with these letters?\n"; print "Type 'y' to move on, or 'n' to get different characters.\n";

It prints a random sequence of 8 chars. I want it to (hence the bottom prints) ask the user if they would like to type y for "that is ok" and move on or n to generate another random sequence for them and ask again.

Can anyone help? ive looked at while, until, unless etc and cant get all of them to work.

you should get rid of this warning: $option needs to be not only declared but also initialized to something for the comparison not to issue this warning (I has the same error in the code I suggested, as I said, it was a quick untested answer).

However, if I understand what you want to do, you probably the test to be the opposite:

Code

my $option = ""; while ($option ne "Y") {

(If the person says yes, it means that she or he is satisfied with the letters and you do not want to go through the will loop again, but want to exit it.)