#!/bin/perl use strict; use warnings; my $choice = 0; my @choices = (undef, "Turkey", "Steak", "Chicken", "Ground Beef", "Mashed Potatoes", "Apple Turnover", "Cherry Pie", "Giblet Stuffing", "Goat Liver", "Goat Cheese", "Head Cheese", "Cheeseburger"); my $num = scalar @choices - 1; print "Choices is $num\n"; while ($choice < 1 or $choice > $num) { print "\nChoose 1 of the $num options:\n"; foreach (1 .. $num) { print "$_ $choices[$_]\n"; } print "\nChoice: "; $choice = ; $choice += 0; } print "\nYou choose $choices[$choice].\n";