in reply to non-XS version of Term::ReadKey?

Term::InKey is a good replacement for Term::ReadKey. See demo.pl for an example.

Replies are listed 'Best First'.
Re^2: non-XS version of Term::ReadKey?
by Anonymous Monk on Feb 08, 2011 at 02:14 UTC
    Term::InKey is a good replacement for Term::ReadKey.

    Doesn't appear so

    http://cpansearch.perl.org/src/RAZINF/Term-InKey-1.04/Term/InKey.pm

    sub WinSetConsole { return $WIN32CONSOLE if $WIN32CONSOLE; require Win32::Console; import Win32::Console; { local *STDERR; open STDERR, ">/dev/null"; $WIN32CONSOLE = Win32::Console-> new(Win32::Console->STD_INPUT_HANDLE); } return $WIN32CONSOLE; }
    /dev/null on windows? and last updated in 2004
      Good point. Thanks.

      If that causes problems for you, then you can always fix it to:

      open STDERR, '>', 'NUL';
      Or take it up a notch with File::Spec::Win32:
      sub WinSetConsole { return $WIN32CONSOLE if $WIN32CONSOLE; require Win32::Console; import Win32::Console; { require File::Spec::Win32; my $devnull = File::Spec::Win32->devnull(); local *STDERR; open STDERR, '>', $devnull; $WIN32CONSOLE = Win32::Console-> new(Win32::Console->STD_INPUT_HANDLE); } return $WIN32CONSOLE; }