http://qs321.pair.com?node_id=183988


in reply to Win32::Console Input Buffer Problem

your problem is that you're creating a console in memory, and this one isn't tied with STDIN. so it has no ways to catch input events. change your new Win32::Console() line to read: new Win32::Console(STD_INPUT_HANDLE) and you'll get the input as you expect.

cheers,
Aldo

__END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;

Replies are listed 'Best First'.
Re: Re: Win32::Console Input Buffer Problem
by osfameron (Hermit) on Jul 22, 2002 at 15:04 UTC
    I have done something similar so many times... I find Win32::Console incredibly confusing though powerful, and I usually cargo-cult my own old scripts, because otherwise it takes me several hours to set up the input and output channels correctly.

    Which is odd, because the module has extensive documentation: I think that it could do with some sort of cookbook though. I'd be interested in helping out with this, if anyone's interested.

    Cheerio!
    Osfameron
    http://osfameron.perlmonk.org/chickenman/