If you've redirected things you should be getting the STDERR output as well.

$ perl -E '$foo = qx{zsh -c "print I GO TO OUT; print I GO TO ERR 1>&2 +" 2>&1}; say qq{foo: |$foo|}' foo: |I GO TO OUT I GO TO ERR |

My suspicion is that the output may be explicitly going to the tty instead of STDERR so redirection this way isn't going to affect it.

Update: Well nope, that's not it. Seems to capture things fine for me (OS X, perl 5.18.2, homebrew'd ffmpeg 4.2.1).

$ perl -E '$foo = qx{ffmpeg -f s16le -i /dev/null 2>&1}; say qq{foo: | +$foo|}' foo: |ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg develope +rs built with Apple LLVM version 10.0.0 (clang-1000.11.45.5) configuration: --prefix=/Users/fletch/lib/homebrew/Cellar/ffmpeg/4.2 +.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avr +esample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines +/jdk1.8.0_221.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMa +chines/jdk1.8.0_221.jdk/Contents/Home/include/darwin' --host-ldflags= + --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enabl +e-libbluray --enable-libmp3lame --enable-libopus --enable-librubberba +nd --enable-libsnappy --enable-libtesseract --enable-libtheora --enab +le-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --e +nable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig - +-enable-libfreetype --enable-frei0r --enable-libass --enable-libopenc +ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-li +brtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disa +ble-libjack --disable-indev=jack libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, s16le, from '/dev/null': Duration: N/A, bitrate: 705 kb/s Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s At least one output file must be specified |

The cake is a lie.
The cake is a lie.
The cake is a lie.


In reply to Re: qx and STDERR? by Fletch
in thread qx and STDERR? by morgon

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.