Call me confused, but the only "exec" I find in your program is in part of a string literal.
Assuming a POSIX system (and probably other Unix systems even if they aren't fully POSIX compliant, it may even hold for some non-Unix systems), filehandles are inherited by the execed process - unless they were marked "close on exec".
But one should realize that file handles are just numbers (well, this is Unix kernel stuff; Unix kernels are written in C; in C, everything is a number (or sequences of numbers); so it's not a surprise file handles are numbers). If your execed process is a Perl program, you'll have to dup a file handle (see perlopentut).
However, given the lack of an exec in your code, I don't really know what your question is.