Perl - JSON

perl

How can we decode a JSON string?

use JSON;
my $jsonObj = JSON->new->utf8->decode($json_text)

How can we encode a Perl variable to a JSON string?

use JSON;
$json_text = JSON->new->utf8->encode($perl_scalar);
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License