Well, the Perl JSON library is indeed unhappy about the lack of quoting, but I think I've got it covered:
$content =~ s/([\{,]\s*)([^:\{,]*):/$1\"$2\":/g; $content =~ s/:([^\[][^,\}]*)([,\}]*)/:\"$1\"$2/g;
=)