in reply to Two threaded program

You are creating a 3 thread process. The simplest way to do what you've described would be:

use strict; use warnings; use threads; async{ open my $In, ...; open my $out, ...; while( <$in> ) { print $out; } }->join;

And that's it. Of course it's not very useful as is, but then neither is what you posted.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.