home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5751 < prev    next >
Encoding:
Text File  |  1992-09-07  |  1.1 KB  |  35 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!mcsun!sunic!psinntp!psinntp!walney!jimrutt
  3. From: jimrutt@walney.com (Jim Rutt)
  4. Subject: Piping to and from a unix command
  5. Message-ID: <1992Sep5.000616.5940@walney.com>
  6. Keywords: unix pipe perl
  7. Organization: JPR Ventures
  8. Date: Sat, 5 Sep 92 00:06:16 GMT
  9. Lines: 24
  10.  
  11.  
  12.  
  13. There's an intriguing aside in the O'Reilly & Assoc PERL book page 163 
  14. in the description of the Open function speaking of using the open 
  15. function to open a pipe to a unix command:
  16.  
  17.     "you may not have an open pipe command that pipes both in 
  18.          and out, though it's easy to build using the _pipe_
  19.          and _fork_ commands."
  20.  
  21. Unfortunately as a not very expereinced UNIXer and "C"er, fork and pipe
  22. just aren't very intuitive for me yet.  
  23.  
  24. What I'm trying to do is open a pipe both to and from the same invocation
  25. of a unix command - say for example grep, that lets me write to the command
  26. and get back the result from it in the same perl program if writing and 
  27. reading from a file.
  28.  
  29. I presume that's what is alluded to in the quote above.  If so, how
  30. do I do it???
  31.  
  32.  
  33.  
  34.  
  35.