Dear Monks,

I have a perl script which takes numerous arguments and, depending on those arguments, dumps a table to stdout. I would like to take that table from the first script and use it as input for the second etc etc. So, for example, in the below commands, I would like to use the table output by "script.pl -y goodbye" as the argument of -x. It seems I need to open a pipe, check for data and if none exists, continue with the script. If there is data, parse it, and pass it as an argument to -x. I feel this is how it should work in my head, but not sure whether this is correct in reality. I'm looking at Pipes and IPC on perl web pages via google, but feeling a bit overwhelmed. Can someone point me to a particular section I should focus on?

script.pl -x hello script.pl -y goodbye | script.pl -x

Thank you very much for you time !


In reply to checking for piped input data 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.