Commits

Toby Inkster  committed 33d69d6

stop using Term::ReadKey (haarg++)

  • Participants
  • Parent commits e3d7e48

Comments (0)

Files changed (1)

File lib/Ask/STDIO.pm

 		my $line;
 		
 		if ($o{hide_text}) {
-			require Term::ReadKey;
-			Term::ReadKey::ReadMode('noecho');
+			require POSIX;
+			my $tio = POSIX::Termios->new;
+			$tio->getattr(0);
+			$tio->setlflag($tio->getlflag & ~POSIX::ECHO());
+			$tio->setattr(0);
 			chomp( $line = <STDIN> );
-			Term::ReadKey::ReadMode(0);
+			$tio->setlflag($tio->getlflag | POSIX::ECHO());
+			$tio->setattr(0);
 		}
 		else {
 			chomp( $line = <STDIN> );