Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!io!al From: al@ee.pitt.edu (Alan Martello) Newsgroups: comp.lang.perl Subject: Problem piping binary data Message-ID: <8120@pitt.UUCP> Date: 17 Jul 90 16:58:57 GMT Sender: news@pitt.UUCP Reply-To: al@ee.pitt.edu (Alan Martello) Organization: Electrical Engineering, Univ. of Pittsburgh Lines: 37 I give up. I want to pipe binary data from one program to another while (possibly) filtering it. Why doesn't this work and how can it be modified to work? ------------------------------------------------------------------------ --------- #!/bin/perl -P # # this works (of course) since the shell does the pipe # system("cat /vmunix | dd of=./vmunix_copy1"); # # how can I make perl do the same thing explicitly ? # THIS DOESN'T WORK # open(TMPFH,"cat /vmunix | "); open(OUTFH, "| dd of=./vmunix_copy2"); while() { printf OUTFH $line; read(TMPFH, $line, $length); } close(OUTFH); close(TMPFH); ------------------------------------------------------------------------ --------- ******************************************************************* Alan R. Martello Electrical Engineering Dept. al@ee.pitt.edu University of Pittsburgh *******************************************************************