in reply to IO::Select woes

I assume this is a continuation of checking for piped input data? I am wondering why you are using IO::Select at all - it seems to me like IPC may be overcomplicating things a lot. Reading the anonymous posts in that and this thread (it would be easier to follow if you were to create an account), I have to say: please take a moment to take a step back and explain the big picture to us - what are you trying to accomplish? Are you:

  1. Simply trying to get one script to consume the output of a second script? Then all you need is print and <>:
    $ cat producer.pl #!/usr/bin/env perl use warnings; use strict; print "Pretend this is your table.\n"; $ cat consumer.pl #!/usr/bin/env perl use warnings; use strict; while ( my $line = <> ) { chomp($line); print "I received: <<$line>>\n"; } $ ./producer.pl | ./consumer.pl I received: <<Pretend this is your table.>> $ ./producer.pl >table.txt $ ./consumer.pl table.txt I received: <<Pretend this is your table.>>
    In addition, you really shouldn't be using ASCII-formatted tables as your data exchange format; use something like JSON to pass data between processes and then only format the table when actually displaying it to the user.
  2. Do you have a long-running script that is once in a while calling another script to produce data (like your table)?
    1. If both are Perl scripts that you have control over, then turn the data-producing script into a Perl module that the main script can use.
    2. Otherwise, if you must call an exernal program, see my node Calling External Commands More Safely, if you scroll down it has a bunch of example code.
  3. Do you have two long-running scripts running side by side that need to talk to each other? Then I recommend sockets, and then IO::Select may be appropriate (though I personally find it too low-level).