Use File::Slurp::Tiny for read_file and write_file
Make sure to treat all source as character data in UTF-8 encoding