
Directing stderr when opening a pipe?
David> I want to read both stdout and stderr of a pipe, a la
David> open(PIPE, "command args |");
David> Unfortunately, I can't find anything in any documentation, nor have my
David> own experiments turned up any way of accomplishing this.
Just use bourne shell syntax:
open PIPE, "command args 2>&1 |";
Simple if you know the One True Shell (/bin/sh). Which everyone should
learn, even if they *are* using Perl.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Web: <A HREF="http://www.teleport.com/~merlyn/">My Home Page!</A>