Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!bcm!convex!tchrist From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: Getting output from stderr Message-ID: <1991Feb22.035920.15312@convex.com> Date: 22 Feb 91 03:59:20 GMT References: <123560@uunet.UU.NET> Sender: tchrist@convex.com (Tom Christiansen) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: comp Organization: CONVEX Software Development, Richardson, TX Lines: 29 From the keyboard of rbj@uunet.UU.NET (Root Boy Jim): :Two ways: First, you ask nicely: "Larry, I know I can say: :$out = `cmd args`; but I want stderr too, so how about if I say: :($out,$err) = `cmd args`; what do you think?" Nope -- breaks code. That reads the first line into $out, the second into $err. :To which Larry will probably respond: "I'm too busy hacking in :even parity generation of BCD trigraphs for RBJ, so take a hike." death to trigraphs. :More likely, you open two pipes, fork, do the standard plumbing, exec :the command in the child, have the parent select on the two pipes until :you've sucked them dry, wait on the child, then close the parent's pipes. : :Hmmmm, that temporary file looks pretty good now don't it? Quite. Or just 2>&1 and don't worry about it. --tom -- "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." -- Doug Gwyn Tom Christiansen tchrist@convex.com convex!tchrist