in reply to Re^2: How to make a menu using my subroutines?
in thread How to make a menu using my subroutines?
You want something like:
my $menu_item; while (lc $menu_item ne 'q') { # allow 'q' to quit print "Enter your choice here: "; $menu_item = <>; chomp($menu_item); (defined $action{$menu_item}) ? $action{$menu_item}->() : print "Wro +ng input. \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to make a menu using my subroutines?
by astronogun (Sexton) on Apr 03, 2012 at 07:32 UTC |