May 26, 2018
Use Cpanel::JSON::XS with a fallback to JSON::PP
JSONMaybeXS tries to load CpanelJSONXS, and if that fails instead tries to load JSONPP. If neither is available, an exception will be thrown.
It then exports the encode_json and decode_json functions from the loaded module, along with a JSON constant that returns the class name for calling new on.