Hi, 
I'm starting to check out IPC with named pipes.
In the following example, my
pipe-writer dosn't work from inside a loop. It only
sends one line and then it all closes. Is this a limitation
of named pipes?  How do you keep the pipe open?


First I create the named-pipe:
#!/bin/sh
mkfifo named-pipe

Then here is the pipe-reader:
#############################################
#!/usr/bin/perl
open(FIFO, "<named-pipe")  or die $!;
while (<FIFO>) {
print "Got: $_";
}
close(FIFO);
##############################################

Here is the pipe-writer:
################################################
#!/usr/bin/perl
open(FIFO, "> named-pipe") or die $!;
$|=1;
#while(1){                 #will not work in this loop
$input = <STDIN>;
print "$input";
print FIFO "$input";
#}

close(FIFO);



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to