title: strange behavior in perl json encoding
body: <p>It seems that printing a hash value to a file may change something internally.</p>
  
  <p>The following code snippet will print (notice there is double quote around 1.6):</p>
  
  <pre><code>{"john":4,"mary":"1.6"}
  </code></pre>
  
  <p>Code snippet:</p>
  
  <pre><code>use JSON::XS;
  
  $a = {};
  $a-&gt;{john} += "4"; 
  $a-&gt;{mary} += "1.6";
  open ($fd, "&gt;tmp.txt") || die "Failed to open file to write $!\n";
  print $fd "$a-&gt;{mary}";
  close $fd;
  $b = encode_json($a);
  print "$b\n";
  </code></pre>
  
  <p>If I comment out the 3 lines on writing to a file in the above:</p>
  
  <pre><code>open ($fd, "&gt;tmp.txt") || die "Failed to open file to write $!\n";
  print $fd "$a-&gt;{mary}";
  close $fd;
  </code></pre>
  
  <p>it will print without double-quote around 1.6.</p>
  
  <pre><code>{"john":4,"mary":1.6}
  </code></pre>
  
  <p>My perl is 5.14.2 running on Ubuntu 12.04 64bit, the JSON::XS module has version 3.01. </p>
  
  <p>Wonder if what is causing this. Thanks.</p>