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

In addition to BrowserUK's suggestion of $|++; # Disable buffering on STDOUT. , the order of the mode change seems significant.

This works:

use Win32::Console ; $cons = new Win32::Console(STD_INPUT_HANDLE) || die "Can't open new co +nsole\n"; $|++; # Disable buffering on STDOUT. ConsoleMode_AND_WITH (~(ENABLE_ECHO_INPUT));# ConsoleMode_AND_WITH ( ~(ENABLE_LINE_INPUT));# while (1) { $char = $cons->InputChar(1) ; last if ord $char == 13 ; print '*' ; $password .= $char ; } print "\nPassword was $password\n" ; $cons->Mode($oldMode) ; sub ConsoleMode_AND_WITH(){ my $o = $cons->Mode(); $cons->Mode($o & shift); print "--Mode change from $o\[" . unpack(q(H2),chr($o)) . " ] to " . $cons->Mode() . "[". unpack(q(H2),chr($cons->Mode())) . "]\n"; }
Changing the order of ConsoleMode_AND_WITH calls produces the "Requires ENTER key" behaviour before anything shows up.

MS documentation says ENABLE_LINE_INPUT OFF should ignore the setting of ENABLE_ECHO_INPUT. But this is probably getting off-topic. Anyway, the code above does what you require, as does Browser's.