in reply to (jeffa) Re: simple menu loop problems
in thread simple menu loop problems
my $input; my @choice = ( 'Cancel FINAL Schedule for machine A', 'Submit new FINAL schedule', 'Ignore Wrkld', 'Run around the block', 'Buy a new car', 'order Pizza', 'exit', ); while (1) { menu(); chomp ($input = <>); last if $input == 7; print "You have chosen option $input\n"; } sub menu { print "Enter a number for the option you want\n"; print map { ($_+1).": $choice[$_]\n" } (0..$#choice); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) 3Re: simple menu loop problems
by jeffa (Bishop) on Mar 12, 2002 at 21:29 UTC |