- or download this
int fd = open("/some/file", O_RDWR);
dup2(fd, 7);
close(fd);
- or download this
int pid = fork();
if (pid == 0) {
execl("/the/perl/program", "program", "arg1", "etc");
_exit("URK!");
}
close(7);
- or download this
open FH, '+<=7';
my $line = <FH>; # or whatever