This is a frequently asked question. See: How can I use a filehandle indirectly?
In reply to Re: File handle as a input variable by jwkrahn in thread File handle as a input variable by hem