Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cis.ohio-state.edu!ucbvax!pasteur!yosemite.berkeley.edu!lars From: lars@yosemite.berkeley.edu (Lars E. Thon) Newsgroups: comp.lang.perl Subject: Double-ended pipes Summary: Do they exist? Keywords: pipe Message-ID: <14054@pasteur.Berkeley.EDU> Date: 11 Jun 91 20:03:21 GMT References: <1991Jun10.180301.7925@NCoast.ORG> Sender: news@pasteur.Berkeley.EDU Reply-To: lars@yosemite.berkeley.edu.UUCP (Lars E. Thon) Organization: UC Berkeley EECS Dept Lines: 29 One feature that I have been missing from perl is having a double-ended pipe. This could be useful f.ex. if you want to feed a lot of commands to a csh and then analyze output and/or status from the commands. For a simple (and contrived) example, consider the following: #! /usr/local/gnu/bin/perl doublepipe_open(CSH_IN, "| /bin/csh -f |", CSH_OUT); #Silly way of checking whether user ~blah exists print CSH_IN "echo ~blah"; $pathname= ; print CSH_IN "echo \$status"; $errcode= ; if ($errcode) { print "User blah does not exist ...\n"; } # END I haven't seen a way to do this in perl, except for the obvious (but unsatisfactory) method of using a temp file to store the csh output. Any ideas about this? -- ---------------------------------------------------------------------------- Lars E. Thon, lars@yukon.berkeley.edu, T. 415-642-9350 211-134 Cory Hall, UC Berkeley, CA 94720