title: Perl Curl PUT and Error 411 (Content Length)
body: <p>I am running Curl command on bash script and it is working perfectly, but the same command when I use in Perl is failing with the error below -</p>
  <p><strong>Error</strong> -</p>
  <pre><code>lb_update o/p: &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;&quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
  &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Length Required&lt;/TITLE&gt;
  &lt;META HTTP-EQUIV=&quot;Content-Type&quot; Content=&quot;text/html; charset=us-ascii&quot;&gt;&lt;/HEAD&gt;
  &lt;BODY&gt;&lt;h2&gt;Length Required&lt;/h2&gt;
  &lt;hr&gt;&lt;p&gt;HTTP Error 411. The request must be chunked or have a content length.&lt;/p&gt;
  &lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>
  <p><strong>Command</strong> -</p>
  <pre><code>curl -H &quot;Content-Type:application/json&quot; -H &quot;Authorization: Bearer $authtoken&quot; -X PUT &quot;https://management.azure.com/subscriptions/&lt;subscription-ID&gt;/resourceGroups/&lt;resource-group&gt;/providers/Microsoft.Network/loadBalancers/&lt;load-balancer&gt;?api-version=$apiversion&quot; -d @output.json
  </code></pre>
  <p><strong>Perl command</strong> -</p>
  <pre><code>$lb_update=`curl -H &quot;Content-Type:application/json&quot; -H &quot;Authorization: Bearer $authtoken&quot; -X PUT &quot;https://management.azure.com/subscriptions/&lt;subscription-ID&gt;/resourceGroups/&lt;resource-group&gt;/providers/Microsoft.Network/loadBalancers/&lt;load-balancer&gt;?api-version=$apiversion&quot; -d @output.json';
  </code></pre>
  <p>I tried to modify the Perl command with the following parameter, but that did not help.
  -H &quot;Content-Length:0&quot; and --ignore-content-length</p>
  <p>I am new to posting questions on these forums, please bear with  me for any mistakes</p>