<div dir="ltr">I think Mojo::JSON handled the booleans about as well as can be expected with Perl.<div><br></div><div>examples:</div><div><br></div><div>perl -Mojo -E 'my $true_scalar = "1"; my $false_scalar = "0"; say j([1, "1", \1, Mojo::JSON->true, \$true_scalar, 0, "0", \0, Mojo::JSON->false, \$false_scalar])'<br></div><div><br></div><div>perl -Mojo -E 'say j([1, \1, Mojo::JSON->true])'<br></div><div><br></div><div>IRC conversation about it:</div><div><a href="http://irclog.perlgeek.de/mojo/2014-11-27">http://irclog.perlgeek.de/mojo/2014-11-27</a><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 10:58 AM, Mark Overmeer <span dir="ltr"><<a href="mailto:mark@overmeer.net" target="_blank">mark@overmeer.net</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* Patrick Powell (<a href="mailto:papowell@astart.com">papowell@astart.com</a>) [141216 15:34]:<br>
> Ummm... and look at JSON and 'true' and 'false'.<br>
<br>
Correct. In Apache::Solr, I ended up building tables of fields and which<br>
are boolean, to automatically translate Perl's concept of booleans into<br>
Solr's URI parameters.<br>
<br>
IMO Perl libraries should attempt to hide the typedness of interfaces...<br>
JSON itself is on a too basic level to do it itself. But interfaces<br>
which transport their data via JSON could (should?) try to automate the<br>
required conversions... often quite some work.<br>
--<br>
Regards,<br>
<br>
MarkOv<br>
<br>
------------------------------------------------------------------------<br>
Mark Overmeer MSc MARKOV Solutions<br>
Mark@Overmeer.net <a href="mailto:solutions@overmeer.net">solutions@overmeer.net</a><br>
<a href="http://Mark.Overmeer.net" target="_blank">http://Mark.Overmeer.net</a> <a href="http://solutions.overmeer.net" target="_blank">http://solutions.overmeer.net</a><br>
<br>
<br>
_______________________________________________<br>
Xml-compile mailing list<br>
<a href="mailto:Xml-compile@lists.scsys.co.uk">Xml-compile@lists.scsys.co.uk</a><br>
<a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile</a><br>
</blockquote></div></div>