#!/usr/bin/perl @answers = ( "Yes", "No", "It shall come to pass", "I believe so", "Not on your life", ); print "I am the all-powerful, all-knowing GENIE!\n"; print "Ask me any question, and I shall tell you the true answer!\n"; print "Just say 'exit' once you are satisfied with my unlimited wisdom!\n\n"; while(1) { print "Question: "; $question = <>; if($question eq "exit\n") { exit; } $answer_number = int(rand($#answers)); print "Answer: $answers[$answer_number]\n"; }