I face the problem of not getting the complete input when reading from STDIN when using select and <STDIN>. Usage: prompt>A.pl | B.pl I have script A output piped to Script B. And I use select call to find out when there is input in the STDIN and then call my $input=<STDIN> when select says that there is data to read. The problem that is faced is that the last 2 lines or sometimes last line is not coming up in the script B. There is no problem with the Script A, since the command A.pl | cat prints all the lines. The problem is only with Select and STDIN. Select doesn't recognize the last line of the input and doesn't say that the STDIN is ready for reading even though data is present. I modified the script in such way that I commented out all select portions and instead had while(1) { my $input=<STDIN>}, the program gets blocked, but it gets the entire input. Any help will be greatly appreciated.

In reply to Select not recognizing input from STDIN by hema99

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.