home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5290 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.4 KB  |  42 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!stanford.edu!rock!cole
  3. From: cole@concert.net (Derrick C. Cole)
  4. Subject: Re: Help with named pipes
  5. Message-ID: <1992Aug13.013018.8953@rock.concert.net>
  6. Sender: news@rock.concert.net
  7. Organization: MCNC Data Operations
  8. References: <1992Aug12.163401.5091@news.eng.convex.com> <1992Aug12.192105.5316@rock.concert.net> <mcook.713657379@fendahl.dev.cdx.mot.com>
  9. Date: Thu, 13 Aug 1992 01:30:18 GMT
  10. Lines: 30
  11.  
  12. In article <mcook.713657379@fendahl.dev.cdx.mot.com> mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:
  13. >
  14. >>Now, 120 is an arbitrary number out of the air.  What I'd really like is for
  15. >>read() to place in $buf a null-terminated string as written by the other end,
  16. >>and not just 120 characters.  Am I completely blind, is there a way to do
  17. >>this, neither, or both?
  18. >
  19. >How about this:
  20. >
  21. >  $/ = "\000";        # the input record separator
  22. >  while (<FIFO>)
  23. >  {
  24. >    chop;        # discard the \0
  25. >    print "|$_|\n";
  26. >  }
  27.  
  28. Greetings, Michael!
  29.  
  30. That _almost_ works (a lot cleaner, too!)  All I did to change the above was
  31. remove the record separator assignment to take the default and voila!  It
  32. works (with the assignment, $_ grows and grows, printing only when the writer
  33. closes!)  Thanks so much for helping me with this trivial problem.
  34.  
  35. Derrick
  36.  
  37. -- 
  38. "GCC 2.0 is to C as SVR4 is to Unix."
  39.                        -- Dick Dunn
  40. ======
  41. Derrick Cole                                  MCNC Center for Communications
  42.