home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5273 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  913 b 

  1. Path: sparky!uunet!gatech!darwin.sura.net!dtix!mimsy!ra!fenner
  2. From: fenner@cmf.nrl.navy.mil (William C Fenner)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Help with named pipes
  5. Message-ID: <3310@ra.nrl.navy.mil>
  6. Date: 12 Aug 92 15:11:56 GMT
  7. References: <1992Aug12.140317.1603@rock.concert.net>
  8. Sender: usenet@ra.nrl.navy.mil
  9. Organization: NRL Connection Machine Facility, Washington, DC
  10. Lines: 20
  11.  
  12. In article <1992Aug12.140317.1603@rock.concert.net> cole@concert.net (Derrick C. Cole) writes:
  13. |#!/usr/local/bin/perl
  14. |
  15. |($pipe) = @ARGV;
  16. |$pipe = "/var/log/modemlog" unless $pipe;
  17. |
  18. |if (-p $pipe) {
  19. |   open(FIFO, "$pipe") || die "can't open $pipe\n";
  20. |   while (<>) {
  21. |      read(FIFO, $buf, 120);
  22. |      print "$buf";
  23. |   }
  24. |} 
  25.  
  26. Why are you reading from <>?  The C code didn't read anything from anything
  27. other than the pipe.  Do you mean while (1)?
  28.  
  29.   Bill
  30. -- 
  31. Bill Fenner                  fenner@cmf.nrl.navy.mil
  32.