On windows, STDOUT comes up missing in this example. Can anyone explain what is happening?
Here's the example: (I more'd this from unix - the scripts run as-is under windows or unix)
-> more bug* :::::::::::::: bugSTDOUT.pl :::::::::::::: #!/usr/bin/perl print STDOUT "Running bugSTDOUTb.pl with backticks\n"; print STDOUT "stdout from bugSTDOUTb.pl=" . `bugSTDOUTb.pl` . "\n"; :::::::::::::: bugSTDOUTb.pl :::::::::::::: #!/usr/bin/perl print STDOUT "Running bugSTDOUTc.pl with system()\n"; system('bugSTDOUTc.pl'); print STDOUT "$0 done\n"; :::::::::::::: bugSTDOUTc.pl :::::::::::::: #!/usr/bin/perl print STDOUT "Hello world!\n";
On unix, the output is as expected:
-> bugSTDOUT.pl Running bugSTDOUTb.pl with backticks stdout from bugSTDOUTb.pl=Running bugSTDOUTc.pl with system() Hello world! /u/geaaron/bin/bugSTDOUTb.pl done
But on windows, the STDOUT from the 3rd script is missing:
D:\My\Tools>bugSTDOUT.pl Running bugSTDOUTb.pl with backticks stdout from bugSTDOUTb.pl=Running bugSTDOUTc.pl with system() D:\My\Tools\bugSTDOUTb.pl done
Where did the STDOUT go? Is there a solution to this problem? I really need windows to do the same thing unix does...

NOTE: This does not happen for STDERR. If you s/STDOUT/STDERR/g things work as expected on both platforms.

Thanks, Aaron


In reply to STDOUT missing on Windows, works on Unix by abecher

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.