home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5275 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.3 KB  |  40 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: <1992Aug12.162224.3119@rock.concert.net>
  6. Sender: news@rock.concert.net
  7. Organization: MCNC Data Operations
  8. References: <1992Aug12.140317.1603@rock.concert.net> <3310@ra.nrl.navy.mil>
  9. Date: Wed, 12 Aug 1992 16:22:24 GMT
  10. Lines: 28
  11.  
  12. In article <3310@ra.nrl.navy.mil> fenner@cmf.nrl.navy.mil (William C Fenner) writes:
  13. >In article <1992Aug12.140317.1603@rock.concert.net> cole@concert.net (Derrick C. Cole) writes:
  14. >|#!/usr/local/bin/perl
  15. >|
  16. >|($pipe) = @ARGV;
  17. >|$pipe = "/var/log/modemlog" unless $pipe;
  18. >|
  19. >|if (-p $pipe) {
  20. >|   open(FIFO, "$pipe") || die "can't open $pipe\n";
  21. >|   while (<>) {
  22. >|      read(FIFO, $buf, 120);
  23. >|      print "$buf";
  24. >|   }
  25. >|} 
  26. >
  27. >Why are you reading from <>?  The C code didn't read anything from anything
  28. >other than the pipe.  Do you mean while (1)?
  29.  
  30. You're right!  It should be while(1).  However, open() still doesn't seem to
  31. return to enter the read loop.
  32.  
  33. Derrick
  34.  
  35. -- 
  36. If I had been an eight foot monster with acidic blood, deadly teeth and claws,
  37. and had been stuck in a story as brain-damaged as that of Aliens 3, I would
  38. have attacked everything in sight too...  oh the humanity!
  39. ======
  40.