in reply to my program will not display a correct answer, to a random question?
Try to ... chomp $ask; if ($ask eq "1") .... Or enter Add instead of 1 (you still need to chomp($ask)).
Some more hints: