Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#505 Issue on reading stdin from console mode

open
nobody
None
5
2008-07-25
2008-07-25
No

Getting following error GetConsoleMode failed, LastError=|6| at C:/Perl/lib/Term/ReadKey.pm line 264.
on using the Term::ReadKey module from
CPAN, which is easier to use and in theory more portable.

[code]
#!c:/perl/bin/perl -w
$|=1; # make STDOUT unbuffered
use Term::ReadKey;
print "Enter your cws password: ";
my $pwd = &_password();

sub _password() {
ReadMode 'noecho';
my $password = ReadLine 0;
chomp ($password); # Removes all CR and LF from the end of the line.
ReadMode 'normal';
return $password;
}

[/code]

if I run from command prompt, it works.

I was not sure where to post and done on EPIC discussion -
http://sourceforge.net/forum/forum.php?thread_id=2136429&forum_id=258687

Discussion

    • priority: 5 --> 9
     
    • priority: 9 --> 5