in reply to utf8 writing

open(HTMLFH, $http_fetch_file);
should be
open(HTMLFH, '<:utf8', $http_fetch_file);

Update: Fixed typo (s/utt8/utf8/)