home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!stanford.edu!rock!cole
- From: cole@concert.net (Derrick C. Cole)
- Subject: Re: Help with named pipes
- Message-ID: <1992Aug12.162224.3119@rock.concert.net>
- Sender: news@rock.concert.net
- Organization: MCNC Data Operations
- References: <1992Aug12.140317.1603@rock.concert.net> <3310@ra.nrl.navy.mil>
- Date: Wed, 12 Aug 1992 16:22:24 GMT
- Lines: 28
-
- In article <3310@ra.nrl.navy.mil> fenner@cmf.nrl.navy.mil (William C Fenner) writes:
- >In article <1992Aug12.140317.1603@rock.concert.net> cole@concert.net (Derrick C. Cole) writes:
- >|#!/usr/local/bin/perl
- >|
- >|($pipe) = @ARGV;
- >|$pipe = "/var/log/modemlog" unless $pipe;
- >|
- >|if (-p $pipe) {
- >| open(FIFO, "$pipe") || die "can't open $pipe\n";
- >| while (<>) {
- >| read(FIFO, $buf, 120);
- >| print "$buf";
- >| }
- >|}
- >
- >Why are you reading from <>? The C code didn't read anything from anything
- >other than the pipe. Do you mean while (1)?
-
- You're right! It should be while(1). However, open() still doesn't seem to
- return to enter the read loop.
-
- Derrick
-
- --
- If I had been an eight foot monster with acidic blood, deadly teeth and claws,
- and had been stuck in a story as brain-damaged as that of Aliens 3, I would
- have attacked everything in sight too... oh the humanity!
- ======
-