David Moron wrote:
> The consumer has only to read lines from its STDIN and print them to
> the STDOUT.

print while(<>);

> 
> These scripts are a simplified version of the producer/consumer
> problem and they try to emulate a multithreaded perl program. IMHO
> It's not important  what I want to do with consumer, the problem is
> that consumer cann't read lines from producer because producer never
> sends EOF. 

Well of course it can read lines. It just can't read *all* the lines into an
array, because the only way for it to know it has read *all* the lines is to
receive an EOF.

>From perldoc perlop:

       If a <FILEHANDLE> is used in a context that is looking for a list, a
       list comprising all input lines is returned, one line per list
element.
       It's easy to grow to a rather large data space this way, so use with
       care.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to