http://www.perlmonks.org?node_id=841121


in reply to [Resolved] how to exec() with my filehandles !

I think you might be looking to change STDIN, STDOUT, STDERR so they point to the files you have opened. See How do I dup() a filehandle in Perl?.
Update: Sorry, I didn't actually read the code, just the description. It looks like you've already read about duplicating filehandles.