in reply to Quoting each word in an arrayref

Can anyone spot what I'm doing wrong?

What you are doing wrong is not using JSON::XS (or JSON::PP) because these will handle quoting and all the other JSON syntax for you. Make life easy on yourself and use a module. Never forget that laziness is one of the three great virtues.