BEGIN { $ENV{PERL_JSON_BACKEND} = 2 } # with JSON::XS use JSON qw( -support_by_pp -convert_blessed_universally ); my $json = new JSON; $json->allow_nonref->allow_blessed->convert_blessed->loose;