in reply to creating empty utf8 file

The BOM is written as part of the first print command on the handle, so if you don't print anything to the handle, you won't get a BOM.
What happens if you print an empty string?
print RET "";