in reply to Re: Re: Re: Sending STDOUT to Multiple Sockets
in thread Sending STDOUT to Multiple Sockets
If that is the case, then your best solution is to have two processes, one of which is reading from the other, the other of which writes to all of the sockets. You can do this in various ways with fork, etc. (The Cookbook has this exact problem as an example.)
UPDATE
Alternate solution. Create a temporary file (for instance
with File::Temp) and then let the code write to
that, seek back to the beginning of the file, read it
and write to the sockets, seek back and truncate. Not
as immediate, but it solves the problem without creating
a new process.
|
|---|