Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to input one char at a time from stdin
I'd like to get a character from stdin, perform some action, get another
character, etc.  If I just use read(stdin, 1).., it waits until I finish typ
ing
a whole line before I can get the first character.  How do I deal with this?


Aleppos

Report this thread to moderator Post Follow-up to this message
Old Post
aleppos
05-08-05 05:10 PM


Re: How to input one char at a time from stdin
Hi,

you can use the Term::Inkey module which can be found here: 
http://search.cpan.org/~razinf/Term...4/Term/InKey.pm


#An example using the Inkey module
use strict;
use warnings;
use Term::InKey;

my $x="";
while($x ne "q"){
	$x = &ReadKey;
	print "You pressed $x\n";
}

Report this thread to moderator Post Follow-up to this message
Old Post
displeaser
05-23-05 03:10 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:52 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.