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

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-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 = STDIN;

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 = STDIN; chomp $type; $type =~ tr/a-z/A-Z/; Here you uppercase the

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 TYPE of server to build.

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 STDIN ); $type1 = 'Wisteria' if $type1 eq 'W'; $type1

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]: ; chomp( $type1 =

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. Mobile

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 = STDIN; chomp $type; $type =~ tr/a-z/A-Z/; if (($type eq LINUX) || ($type eq L)) { $type = Linux; } if (($type eq