How to derefence a copy of a STDIN filehandle?
Your $filehandle
should already be open - you had opened FILECOPY
, taken a reference and put it in $FH_ref
, which is $filehandle
. If you want to re-open it again use the <&
argument in open
or just start reading from it right away.
If I understand correctly, you want the 3-arg equivalent of
open my $fh, '<&STDIN'
That would be
open my $fh, '<&', $filehandle