See Re: Duping filehandles.
In reply to Re: dup() in perl by ambrus in thread dup() in perl by vinoth.ree