I'm wondering if there is an easy way to execute a shell command and simply capture all of STDERR and STDOUT into a string, potentially without using IPC.

That question makes no sense. "IPC" stands for "Inter-process communication". What do you think you're doing when you're getting data from your child's STDOUT?

Maybe you're trying to avoid select? Now that's achievable. Just like backticks lets someone else handle the IPC, there are modules that do that for more complicated cases.

use IPC::Run3 qw( run3 ); run3( \@cmd, undef, \(my $out), \(my $err) );

IPC::Run3


In reply to Re: Easy way to capture STDOUT and STDERR without IPC by ikegami
in thread Easy way to capture STDOUT and STDERR without IPC by rastoboy

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.