```{index} single: decode (JSON::XS) ``` ```{index} single: JSON::XS::decode ``` # decode JSON text to Perl data, with this object's options. ## Synopsis ```perl 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.