| | Handwaving here | use strict; use CGI qw/ :all /; my $cgi = new CGI; # This hash reference contains the parameters for # the question... my $question = fetchRandomQueston(); # # This array contains hash references for the answers my @answers = fetchAnswers($question->{quis_question_id}); | | some handwaving here | print $question->{quiz_question},"\n"; print hidden("quiz_question_id", $queston->{quiz_question_id}),br; # There are better ways.. but I'm doing this way # for clarity my %labels = map { $_ -> {quiz_answer_id} => $_ ->{quiz_answer} } @answers; print radio_group( -name=> 'user_answer_rq', -values=> [ map { $_->{quiz_answer_id} } @answers ], -labels => \%labels, -linebreaks => 'true' ),br; print submit;