It will be a really good idea to write out your algorithm before programming it.
As test cases the following codes and guesses should return the following 2 numbers.
Correct color and Correct color but CODE GUESS in the right place. wrong place. R G Y L R R R R 1 0 R R Y L L Y R L 1 2 G Y L L L L G Y 0 4
Write a form and perl script that asks the user their name, age, favorite color, favorite type of music, sex, continents the person has been to, and a 5 other questions of your choice. The name should be done as a text field, the music should be done from a list of choices, the continents should be done with radial buttons. The other you can do what ever makes sense.
You should then print out the information they entered so they can check that they did it correctly. Add a suggestion that they use "back" if they made an error.