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).

In reply to Re: IO::Select woes by haukex
in thread IO::Select woes by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.