lacertus has asked for the wisdom of the Perl Monks concerning the following question:
For some reason, the while loop does not accept *any* input (that is, 'y' or 'Y') as being valid? And yet an slightly altered form of the input check in the form of an if statement works fine. Please, any help would greatly ease my mind!$i=0; do { print "Not an option!\n" if $i>0; print "Are you to proceed? (y/n): "; chomp($make_account = <STDIN>); ++$i; die "\nCiao!\n" if (($make_account eq 'n') || ($make_account e +q 'N')); } while ( ($make_account ne 'y') || ($make_account ne 'Y') );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: do-while loop question
by bart (Canon) on Mar 13, 2003 at 10:17 UTC | |
|
Re: do-while loop question
by grinder (Bishop) on Mar 13, 2003 at 11:02 UTC | |
|
Re: do-while loop question
by vagnerr (Prior) on Mar 13, 2003 at 10:25 UTC | |
|
Re: do-while loop question
by virtualsue (Vicar) on Mar 13, 2003 at 11:33 UTC | |
by grinder (Bishop) on Mar 13, 2003 at 11:59 UTC | |
by Coruscate (Sexton) on Mar 13, 2003 at 22:11 UTC |