Skip to content

How to handle old JSON::XS version #48

@rovo89

Description

@rovo89

I have a scenario with hundreds of servers with different Perl versions and operating systems. On these servers, I need to run a script which decodes a JSON file. I can push additional libraries to the servers via a shared directory, but due to the different Perl versions, they can't contain XS code.

I'd like to leverage a pre-installed JSON::XS wherever possible and fall back to JSON::PP otherwise. Caveat: I use boolean_values(), which is only available from version 4.0. Various servers have only JSON::XS version 3.0.1, so this call fails.

Is there any way to use JSON::XS only if it has a certain minimum version / supports a certain method and use PP otherwise?
I also tried -support_by_pp, but it didn't help here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions