decode#
JSON text to Perl data, with this object’s options.
Synopsis#
my $data = JSON::XS->new->relaxed->decode('[1, 2, # a comment
3,]');
What you get back#
The Perl structure: true and false as Types::Serialiser’s booleans, null as undef, numbers as numbers. Dies with the reason and the character offset on text that is not valid JSON.