Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > STDIN Question

Reply
Thread Tools

STDIN Question

 
 
Hobbit HK
Guest
Posts: n/a
 
      12-24-2003
I know that if I do:
$line=<STDIN>;

I'll read from STDIN until I'll press ENTER... My question is, how can
I change it? I mean, can I do that if I'll press, for example, "c"
it'll stop reading from STDIN? or, alternatively, can I do that it'll
stop reading after 2 chars?
 
Reply With Quote
 
 
 
 
David Efflandt
Guest
Posts: n/a
 
      12-24-2003
On 24 Dec 2003 09:45:50 -0800, Hobbit HK <(E-Mail Removed)> wrote:
> I know that if I do:
> $line=<STDIN>;
>
> I'll read from STDIN until I'll press ENTER... My question is, how can
> I change it? I mean, can I do that if I'll press, for example, "c"
> it'll stop reading from STDIN? or, alternatively, can I do that it'll
> stop reading after 2 chars?


perldoc -q key

I do know if those methods display each key pressed or leave it up to you
to echo them to the screen (with output buffering disabled and print
without newline, although, you may need a newline after accepting last
input).

--
David Efflandt - All spam ignored http://www.de-srv.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
peek at stdin, flush stdin Johnathan Doe C Programming 5 05-17-2013 04:30 PM
How to pass stdin of a C++ program to the stdin of a process createdwith ShellExecute() Ben C Programming 2 08-29-2009 09:47 PM
STDIN, OUT, ERR and $stdin, out, err - Differences? Terry Cooper Ruby 7 06-09-2009 05:48 AM
Reading from stdin then launching a program that reads from stdin strange behaviour Stefano Sabatini Perl Misc 6 07-29-2007 10:38 PM
Reading stdin once confuses second stdin read Charlie Zender C Programming 6 06-21-2004 01:39 PM



Advertisments