in reply to Text file to UTF-8 encoding

map {Encode::encode("utf-8", $_)} @FileData;
Shouldn't you be saving the result of the map?
@FileData = map {Encode::encode("utf-8", $_)} @FileData;


Unless I state otherwise, all my code runs with strict and warnings