Hello Monks,

One of the first things my web-based application does is run another program. The problem is that this program prints a bunch of stuff I am not interested in to STDOUT, which means that if I use system(), all of that stuff is printed to the browser, followed by the html text of my webpage.

What I want it to do is ignore all of that stuff being sent to STDOUT by this other program and wait until this other program is finished before continuing.

I know that this other program is done because it creates a text file that is parsed by the rest of my program.

My current hack is to use backticks to collect that STDOUT junk and wait until it is possible to open the text file before continuing:

my $out = `"python extractx.py $folder/junction.fasta"` wait until(open NULL, "$folder/junction.fasta.allseqs.txt");

This is all I could come up with, but I'm assuming that I could also temporarily change where STDOUT goes until the program is done, and then change it back to the default, but I'm not sure if that is possible or how to do it.

Thanks in advance for any help.


In reply to STDOUT Issues by nodice

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.