JSON::XS under mod_perl fails with POST requests
<p>I am using the default install of Apache and mod_perl on Ubuntu 16.04.1 LTS, I also have reproduced this with the default JSON::XS and I updated to the latest from CPAN JSON-XS-3.02.</p>

<p>The code below works in all cases if I am not using mod_perl.  </p>

<p>The script and html below work when using perl via mod_cgi with both POST and GET requests.</p>

<p>If however I am using mod_perl and I use a POST (as in the html provided) it fails, "Hello" does not print,  and I get the following error in my apache log file.</p>

<p>Usage: JSON::XS::new(klass).</p>

<p>If I pass the same parameter(s) via a GET method, the script works fine.</p>

<p>test2.pl</p>

<pre><code>#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use JSON::XS;

my $q = new CGI();
print $q-&gt;header(-type =&gt; 'text/plain');
my $action = $q-&gt;param('a');
my $json_str = '{"foo":"bar"}';
my $pscalar = JSON::XS-&gt;new-&gt;utf8-&gt;decode($json_str);
print "Hello";
exit 1;
</code></pre>

<p>HTML to call the above (named test2.pl on the server)</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;form action="test2.pl" method="POST"&gt;
&lt;input type="text" name="a"/&gt;
&lt;button type="submit"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>