Dear Monks - I am trying to write a piece of code to capture user input?if choice is "y" execute a piece of code, choice is "n" do nothing,anything else ask the user to enter the choice again?Can anyone advise how to do it?
START: print "\nDo you want to continue : "; $choice = <>; chomp ($choice); if ( $choice != "y" && $choice != "n" ) { print "\nERROR:Invalid Choice\n"; goto START; } if($choice == "y") { }
In reply to Continure when "y" and none for "n" by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |