LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 04-28-2010, 02:55 PM   #1
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,241

Rep: Reputation: 194Reputation: 194
Read from stdin in perl, do not wait for EOF


I am trying to read one line at a time in perl and not wait for stdin eof to start the action:
Code:
foreach(<STDIN>){
<do something>
}
if i pipe ls into it, it waits for ls to be done before doing the action.
 
Old 04-28-2010, 04:17 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,241

Original Poster
Rep: Reputation: 194Reputation: 194
Never mind -=- I replaced foreach with while.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache+Perl: interruption of STDIN sevmax Linux - Server 0 10-13-2009 04:42 AM
Perl adding unwanted lines at EOF? ryedunn Programming 1 09-07-2006 10:35 AM
Reading from stdin till eof stuck when sending multiple commands fredyk_ Linux - Software 1 04-25-2006 03:23 AM
Send EOF to stdin? (C) smoothdogg00 Programming 3 03-07-2006 08:10 PM
How to Encrypt <STDIN> in PERL 5.8 SPo2 Programming 2 01-21-2006 01:46 AM


All times are GMT -5. The time now is 05:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration