Hi Bill, I know you've had lots of comments on this, but I thought I'd throw my own style in. Why not do your check at the bottom with a "do until"? First time round the check is useless anyway, and will give you 'undef' type warnings with perl -w. It also allows you to be more positive in your condition checking.
For example... do { print "Enter TYPE of server to build. Linux or Windoze [linux, windows]:\n"; $type = <STDIN>; chomp $type; $type =~ tr/a-z/A-Z/; if (($type eq "LINUX") || ($type eq "L")) { $type = "Linux"; } if (($type eq "WINDOWS") || ($type eq "W")) { $type = "Windows"; } } until (($type eq "Windows") || ($type eq "Linux")); Rob "Bill Akins" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all! > > I have this while loop in my script: > > while (($type ne "Windows") || ($type ne "Linux")) { > print "Enter TYPE of server to build. Linux or Windoze [linux, windows]: > \n"; > $type = <STDIN>; > chomp $type; > $type =~ tr/a-z/A-Z/; > if (($type eq "LINUX") || ($type eq "L")) { > $type = "Linux"; } > if (($type eq "WINDOWS") || ($type eq "W")) { > $type = "Windows"; } > } > > I had hoped that it would prompt the user until they made a valid > choice, either L, linux, w or windows. Instead it loops over and over > even if valid input is received. What am I doing wrong here? > > I have another while loop that works just fine: > > while ($LUN !~ /\d+.\d+.\d+.\d+/) { > print "Enter LUN to build boot partition on. LUN Format is 3.0.0.33 > [X.X.X.X]: \n"; > $LUN = <STDIN>; > chomp $LUN; } > > Thanx! > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]