Path: utzoo!utgpu!watserv1!watmath!att!occrsh!uokmax!apple!olivea!orc!inews!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: Perl 3.0 PL28 problems with pipe() Keywords: Pipe call is a problem Message-ID: <1990Sep4.215525.19491@iwarp.intel.com> Date: 4 Sep 90 21:55:25 GMT References: <1990Sep4.205514.13088@math-cs.kent.edu> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 19 In-Reply-To: gorpong@math-cs.kent.edu (Gordon C. Galligher) In article <1990Sep4.205514.13088@math-cs.kent.edu>, gorpong@math-cs (Gordon C. Galligher) writes: | There is some synchronization problems when dealing with pipes via the | pipe() call in Perl. Below are code examples first in PERL and then one | in C. The one in C works just like you would expect: | $mval = 25; | print "CHILD-SEND: $mval\n"; | print DESC1_1 $mval; Well, there's your problem. You're not printing a newline, so the read on the otherside hangs until it sees a newline. Use getc() [ugh] or append a \n, or write fixed-size goodies (as you did in C) with pack/unpack and then use read. pipe(R,W);fork?close(R)&&print W "Just another Perl hacker,":close(W)&&print -- /=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!"=/