while (($input = <STDIN>) < 7)
?
And the reason it is exiting is that you are using if, not elsif. So this bit:
if($input == 6) { print "You have chosen option 6\n"; } else { exit; }
always exits unless you choose option 6. You could have found out how your program was working with the debugger: perl -d program.pl, then use 's' or 'n' to step through each line of your program.
dave hj~
In reply to Re: simple menu loop problems
by dash2
in thread simple menu loop problems
by ddrumguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |