JSON encodes numbers differently than strings. JSON::PP uses B to peek at the internals of scalars to figure out how the value of the scalar is stored to guess if it's more appropriate to store a scalar as a string or as a number.
You could create a copy of JSON::PP that encodes everything as strings, removing the need for B. (Scalar::Util's reftype would do for the other uses of B, and ref could be used if even that's not available.)
An alternative would be to install JSON::XS on one machine and copy the installed files over. That would require a machine with the same architecture and Perl version as the target. The perl on the source would have to be built with the same options as the perl on the target.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|