in reply to Win32::Console Modes not Working on XP

Disabling buffering on STDOUT seems to do the trick. Using strict and lexicals does hurt either.

#! perl -sw use strict; use Win32::Console ; $|++; # Disable buffering on STDOUT. my $password; my $cons = new Win32::Console(STD_INPUT_HANDLE) || die "Can't open new + console\n"; my $oldMode = $cons->Mode ; $cons->Mode(~(ENABLE_LINE_INPUT|ENABLE_ECHO_INPUT) & $oldMode ); while (1) { my $char = $cons->InputChar(1) ; last if ord $char == 13 ; print '*' ; $password .= $char ; } print "\nPassword was $password\n" ; $cons->Mode($oldMode) ; __END__ P:\test>junk **** Password was fred

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller