We don't bite newbies here... much | |
PerlMonks |
Re: Formatting JSON the right wayby Anonymous Monk |
on Aug 21, 2014 at 02:28 UTC ( [id://1098185]=note: print w/replies, xml ) | Need Help?? |
Construct a complete hashref structure containing the entire JSON packet that you want to transmit, then encode_json to prepare the string to send. When receiving data from the host, do the opposite with decode_json. In this way, the JSON encoder/decoder becomes a black-box and the text-string is a mystery that only the black-box needs to know how to handle.
In Section
Seekers of Perl Wisdom
|
|