Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!brutus.cs.uiuc.edu!apple!oliveb!orc!mipos3!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: how to read stdout AND stderr from a program Message-ID: <1990Mar2.070445.7895@iwarp.intel.com> Date: 2 Mar 90 07:04:45 GMT References: <7001@pitt.UUCP> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 22 In-Reply-To: al@ee.pitt.edu (Alan Martello) In article <7001@pitt.UUCP>, al@ee (Alan Martello) writes: | Related to my previous posting concerning dumps, I want | to do open(FH, "program |&") --- but this doesn't work. | Is there an easy way to accomplish the same thing? | (I tried "program |& cat |") but to no avail.... That's cuz system() and friends follow the syntax of the One True Shell, the Bourne shell. (Csh is a hack-turned-least-common-denominator, sorta like VHS tape and processors that end in 86, but that's another story...) All Unix hackers should learn the syntax of /bin/sh and /bin/ed, to see where all these nifties actually started. Enough motherhood and apple pie. The answer to your question is: open(FH,"program 2>&1|") print "Just another Perl hacker," if "there's nothing better to do"; -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/