Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

pipe

Creates a unidirectional pipe pair (read end + write end).

Calls the POSIX pipe(2) system call to create a connected pair of file descriptors. The first argument receives the read end and the second receives the write end, both as filehandles.

Typically used together with fork to set up inter-process communication. Returns 1 on success or undef on failure (with $! set to the system error).

Synopsis

pipe(my $read_fh, my $write_fh) or die "pipe: $!";

See Also

open, close