open DEBUGFILE, '>', "debug.txt" or die $!; binmode DEBUGFILE, ":encoding(UTF-8)";