LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 01:55 PM   #1
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,230

Rep: Reputation: 173Reputation: 173
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, 03:17 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,230

Original Poster
Rep: Reputation: 173Reputation: 173
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 03:42 AM
Perl adding unwanted lines at EOF? ryedunn Programming 1 09-07-2006 09:35 AM
Reading from stdin till eof stuck when sending multiple commands fredyk_ Linux - Software 1 04-25-2006 02:23 AM
Send EOF to stdin? (C) smoothdogg00 Programming 3 03-07-2006 07:10 PM
How to Encrypt <STDIN> in PERL 5.8 SPo2 Programming 2 01-21-2006 12:46 AM


All times are GMT -5. The time now is 06:21 AM.

Main Menu
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