Cannot set binmode when $fh is undefined