in reply to JSON into string
File::Slurp is notoriously bad at reading files that have an encoding. Most likely, a good approach is to avoid using it and reading the file yourself.