Re: While loop, confused... - Thanks!

2003-07-03 Thread Bill Akins
Thank you all for your responses!! I finally have a handle on it and used a little of everyones suggestions. This list rocks because of people like you. Thanks again!

Re: While loop, confused...

2003-07-03 Thread Rob Anderson
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 co

RE: While loop, confused...

2003-07-02 Thread Shishir K. Singh
>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 = ; >chomp $type; >$type =~ tr/a-z/A-Z/; >if (($type eq "LINUX") || ($type eq "L")) { >$type = "Linux"; } >i

RE: While loop, confused...

2003-07-02 Thread Charles K. Clarkson
Bill Akins <[EMAIL PROTECTED]> wrote: : : while (($type ne "Windows") || ($type ne "Linux")) { This will always be true. Try: while ( $type ne 'Windows' && $type ne 'Linux' ) { ^^ HTH, Charles K. Clarkson -- Head Bottle Washer, Clarkson Energy Homes, Inc.

Re: While loop, confused...

2003-07-02 Thread Kevin Pfeiffer
Sorry... In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > > >> Here's an 'or' version: >> my $type1 = ''; >> while ( $type1 !~ /wisteria|lime/i ) { >>print "Enter COLOR of server. Lime or Wisteria [lime, wisteria]: "; >>chom

Re: While loop, confused...

2003-07-02 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: > Here's an 'or' version: > my $type1 = ''; > while ( $type1 !~ /wisteria|lime/i ) { >print "Enter COLOR of server. Lime or Wisteria [lime, wisteria]: "; >chomp( $type1 = ucfirst lc ); >$type1 = 'Wisteria' if $type1 eq 'W'; >$

Re: While loop, confused...

2003-07-02 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, John W. Krahn wrote: > Bill Akins wrote: >> >> Hi all! > > Hello, > >> I have this while loop in my script: >> >> while (($type ne "Windows") || ($type ne "Linux")) { > > Your problem is that you are using or when you should be using and. > > >> print "Enter

RE: While loop, confused...

2003-07-02 Thread Bill Akins
> > while (($type ne "Windows") || ($type ne "Linux")) { > Right here, you must have the full string "Windows" or "Linux" Yes, correct. > > print "Enter TYPE of server to build. Linux or Windoze > > [linux, windows]: > > \n"; > > $type = ; > > chomp $type; > > $type =~ tr/a-z/A-Z/; > > Here yo

Re: While loop, confused...

2003-07-02 Thread John W. Krahn
Bill Akins wrote: > > Hi all! Hello, > I have this while loop in my script: > > while (($type ne "Windows") || ($type ne "Linux")) { Your problem is that you are using or when you should be using and. > print "Enter TYPE of server to build. Linux or Windoze [linux, windows]: > \n"; > $type =

RE: While loop, confused...

2003-07-02 Thread LoBue, Mark
> -Original Message- > From: Bill Akins [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 02, 2003 3:48 PM > To: [EMAIL PROTECTED] > Subject: While loop, confused... > > > Hi all! > > I have this while loop in my script: > > while (($type ne "Windows") || ($type ne "Linux")) { Right