[Thamesvalley-pm] Equivalent to Term::ReadKey

Mark Robson mark.robson at surfcontrol.com
Fri Jun 27 06:28:48 PDT 2008


On Fri, 2008-06-27 at 14:13 +0100, Greg Matthews wrote:
> Red Hat Enterprise (in its infinite wisdom) chooses not to ship 
> Term::ReadKey with their perl. Is there an equivalent to the following 
> that will be portable to an unmodified RHEL host:
> 
> ReadMode 'noecho';
> $pass0 = ReadLine(0);
> ReadMode 'normal';
> chomp $pass0;
> print "\n";
> exit unless $pass0;

You could shell out to "stty -echo"  and "stty echo" to disable and
enable echo.

Or you could install Term::ReadKey from an RPM that you build yourself
(building RPMs of perl modules isn't that difficult, rpmforge has
many .spec files pre-build)

Depends how your deployment process works and how many different distros
you need to support.

Mark


 Protected by Websense Messaging Security -- www.websense.com 


More information about the Thamesvalley-pm mailing list