in reply to Sub Routine Malfunction

When you first enter your while loop, $answer is a number, but you (almost) immediately covert it to a word, so successive comparisons of $answer and 9 are probably not doing what you expect. :-)

Also, remember that array indices in Perl start at.... 0. On second look, the indexing looks OK. But tracking parallel arrays can get hairy when they need to be updated. jwkrahn's suggestion to use a hash avoids that problem.