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