in reply to typeglob questions

Using typeglobs you can generate a reference to your format or io (dirhandle or filehandle) and then pass these, which very easy:

$io_ref = *typeglob{IO}; $format_ref = *typeglob{FORMAT};

Regards,
-octo