in reply to Menu Troubles..

Save each line of input to a variable and compare the variable like:
# get input $input = <STDIN>; #----------------------If user Picks 1-------------------# if($input == int 1) { system "cls"; $fname = ""; while ($fname eq "") { printf "\n\nPlease Enter your First Name: "; $fname = <STDIN>; chomp($fname); &menu; }#end of while loop }#end of if(); #----------------------If user Picks 2-------------------# if($input == int 2) { system "cls"; $lname = ""; while ($lname eq "") { printf "\n\nPlease Enter your Last Name: "; $lname = <STDIN>; chomp($lname); &menu; }#end of while loop }#end of if();
Update: samtregar beat me to the punch

Replies are listed 'Best First'.
Re^2: Menu Troubles..
by Snowman11 (Novice) on Jun 15, 2005 at 21:56 UTC
    Thats awesome and it worked great! Thanx Just a quick question i can now go through and change all the values but i can only do it once. Wondering if i would need a while loop so that i can press "1" and enter value which changes the value of fname in this case then brings me back to the menu then press "1" to repeat this process.
      I'm not sure I understand quite what you mean, but when I ran the appropriately edited snippet, the script returned to the main menu because of the &menu call at the end of each if statment. A loop shouldn't be required. Just make sure that the <STDIN> statement is within the menu subroutine. Note: if no valid input is received you return from your subroutine, and it doesn't loop back to the main menu as written.