$errmsg, $res)
sub _parse_json {
my $str = shift;
state $json = do {
require JSON::PP;
JSON::PP->new->allow_nonref;
};
# to rid of those JSON::PP::Boolean objects whi
rk of JSON::PP which doesn't
# produce those in the first place (probably only when performance is
# critical).
state $cleanser = do {
if (eval { require Data::Clean::FromJSON; 1 }
) {
Data::Clean::FromJSON->get_cleanser;
} else {
undef;
}
};
my $res;
eval { $res = $json->decode($str); $cleanser->clean_in_place($res) if $clean