in reply to returning filehandles

It might make things easier on you if you used IO::File and/or IO::Handle to get real scalars that are functionally filehandles. Then you can pass things around just like any other scalar, assign them, etc.

Otherwise, try using typeglob assignments (e.g. *FILEHANDLE = whatever).