in reply to Re: JSON error '"' expected, at character offset 1
in thread JSON error '"' expected, at character offset 1

Thanks a lot everyone, both solution works. I'll use  $response =~s/[{:,]\K(\w+)(?=[:,}])/"$1"/g; to limit module usage, but PP is fine.

Replies are listed 'Best First'.
Re^3: JSON error '"' expected, at character offset 1
by ikegami (Patriarch) on Jan 02, 2010 at 16:37 UTC
    What's wrong with using a module, and why would you rather do it wrong? (Your thing won't work if any string contains a double quote, for example.)
      Right, I finally use JSON::PP because the JSON I get is really bad, so I need thoses allow_xxx methodes.

      Your regep is still a nice pice of code for the ones who need to use JSON::XS.

      Thanks again St ikegami, you've got my 畏敬 respect.