Your first question is not really Perl related, it is an issue with the shell (cmd.exe) you are using. For example, Bash has an array of pipe return codes, however this is quite difficult in shells like csh and ksh. I don't think you can do it in cmd.exe.
However, there is an alternative using Perl. Run your build.exe in a pipe:
open(my $fh, "C:\\IA71_Enterprise\\build.exe $ProjFile 2>&1 |") or die
+ "$!"
and do the tee yourself in Perl, you can get the return code from $?.
The tee utility in DOS can't redirect the STDERR output to a fileYou answered this question yourself in your
system command. Redirect stderr (Windows file handle 2) to stdout (Windows file handle 1) before the tee using
2>&1.
By the way, this might be being pedantic, but I doubt you are actually running a DOS program. PC or MS-DOS was 16-bit, you are probably running a 32-bit console program - at least, I hope you are!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.