+ my $lines = 0;
+ my $body = "";
+ my $cmd = "( $text_program ) 2>&1";
+ # $cmd .= " | sed -l"; # line buffer instead of 4k pipe buffer
+ open (my $pipe, '-|:unix', $cmd);
+ while (my $line = <$pipe>) {
+ $body .= $line;
+ $lines++;
+ last if ($truncate_lines && $lines > $truncate_lines);
+ }
+ close $pipe;
+ $body = reformat_text ($body);
+ print STDOUT $body;