my $KeyPressed; while (defined ($KeyPressed = $StdIn->InputChar(1)))
It's possible to maintain the scoping of $KeyPressed used in the OP code:
while (defined(my $KeyPressed = $StdIn->InputChar(1))) {
...
}
The reason the original code 'fails' is that a '0' character entered by the user evaluates as false, and the while loop ceases iteration in consequence.
In reply to Re^2: masking password entry
by AnomalousMonk
in thread masking password entry
by obonaventure
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |