in reply to Problem parsing json

After comparong the output from https://corion.net/curl2lwp.psgi with your Perl, it looks to me like there is a difference in the JSON from your curl and the JSON in your script. Especially the "from" and "to" subkeys have different datatypes.