dup2#

Duplicate $fd1 onto $fd2, closing $fd2 first if necessary.

Synopsis#

POSIX::dup2($fd, 1);   # redirect stdout to $fd

What you get back#

The target fd on success, undef on failure. Either argument being negative is rejected with $! set to EBADF.

Differences from upstream#

Fully compatible with upstream POSIX.