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
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!
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;
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
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.
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
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 =
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
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