Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: How do I make the JSON module convert true/false to 1/0 instead of a blessed Boolean object?

by ikegami (Patriarch)
on Jan 03, 2022 at 14:24 UTC ( [id://11140112]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How do I make the JSON module convert true/false to 1/0 instead of a blessed Boolean object?
in thread How do I make the JSON module convert true/false to 1/0 instead of a blessed Boolean object?

Both JSON::PP and JSON::XS support boolean_values, and the error message said the method wasn't found in JSON, not JSON::XS.

  • Comment on Re^4: How do I make the JSON module convert true/false to 1/0 instead of a blessed Boolean object?
  • Download Code

Replies are listed 'Best First'.
Re^5: How do I make the JSON module convert true/false to 1/0 instead of a blessed Boolean object?
by Cody Fendant (Hermit) on Jan 03, 2022 at 22:22 UTC

    Well my question is about JSON, but if the answer is to use one of the other modules specifically then I guess that works.

    I would still say the documentation could be improved though.

      That's not what I was suggesting. JSON.pm isn't a JSON parser. It's merely a front end for JSON::PP and JSON::XS. The post to which I was replying suggested that boolean_values works when JSON.pm acts as a front end for JSON::PP, but doesn't work when it acts as a front-end for JSON::XS. I was stating that this is incorrect. It works for both back ends.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140112]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-23 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found