start page | rating of books | rating of authors | reviews | copyrights

Programming Perl

Programming PerlSearch this book
Previous: 3.2.106 package Chapter 3
Functions
Next: 3.2.108 pop
 

3.2.107 pipe

pipe 

READHANDLE

, 

WRITEHANDLE

Like the corresponding system call, this function opens a pair of connected pipes - see pipe (2). This call is almost always used right before a fork , after which the pipe's reader should close WRITEHANDLE , and the writer close READHANDLE . (Otherwise the pipe won't indicate EOF to the reader when the writer closes it.) Note that if you set up a loop of piped processes, deadlock can occur unless you are very careful. In addition, note that Perl's pipes use standard I/O buffering, so you may need to set $| on your WRITEHANDLE to flush after each output command, depending on the application - see select ( output filehandle ).

See also the section on "Pipes" in Chapter 6 .


Previous: 3.2.106 package Programming Perl Next: 3.2.108 pop
3.2.106 package Book Index 3.2.108 pop