pipe#

Synopsis#

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

Description#

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).

See also#

open, close