in reply to Re^2: duping a filehandle
in thread duping a filehandle

Alternatively, pass just the filename to your sub and open it there using a different file handle (preferably lexical).