Simpler:
open (my $fh2, '>:encoding(UTF-16)', $textfile2) [download]
In reply to Re^5: Unicode issues with emc uemcli by ikegami in thread Unicode issues with emc uemcli by pritesh_ugrankar