<div class="gmail_quote">On 21 May 2012 17:36, Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com" target="_blank">kremenek@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div class="im"><div><div>On May 21, 2012, at 5:31 PM, Nick Lewycky <<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.com</a>> wrote:</div><br><blockquote type="cite">

<blockquote class="gmail_quote" style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

+#!/usr/bin/perl -w<br>+use strict;<br>+my \$BAD = 1;<br>+my \$GOOD = 0;<br>+`rm -f $reduceOut`;<br>+my \$command = "$commandStr > $reduceOut 2>&1";<br>+system(\$command);<br>+open(IN, "$reduceOut") or exit(\$BAD);<br>

</blockquote><div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

<br></div><div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

open(IN, "$command|") or exit(\$BAD);</div><div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">

 </div></blockquote></div><br></div><div>That's not quite the same.  That doesn't capture both stdout and stderr.</div></div></blockquote></div><br><div>Good point. That can be fixed by changing to "my $command = $commandStr 2>&1" can't it? Something like this:</div>

<div><br></div><div>open(IN, "$commandStr 2>&1 |") or die $BAD;</div><div><br></div><div>or were you trying to keep stdout and stderr output separate? Your current command doesn't.</div><div><br></div>

<div>Nick</div><div><br></div>