in reply to Re^2: Sending commands to another process that isn't expecting it
in thread Sending commands to another process that isn't expecting it

The classical answer is a select loop. POE is a framework to do a select loop. Basically, a select loop means, you have three (possible empty) sets of filehandles: handles you want to read from, handles you want to write to, handles you're watching for errors. Using a select call (4 arg select, for details, see the manual page), you wait until "something" happens: one or more of the handles you are waiting on comes available, or a timeout happens. So, you use one of the handles to read from your pipe (or stdin), and the other handles to read your RSS feed. Do whatever is appropriate when a handle becomes available.

Personally, for simple things, I use 4-arg select. For more complicated things, I'd use POE. (Note that POE isn't the only framework available).

  • Comment on Re^3: Sending commands to another process that isn't expecting it

Replies are listed 'Best First'.
Re^4: Sending commands to another process that isn't expecting it
by mikealeonetti (Novice) on Dec 05, 2010 at 22:04 UTC

    Ooo. That's pretty cool. Thanks.