Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You have built an inifinte loop. That's where your out of memory warning is coming from.</p> <pre><code>my $message="test"; open(XML,$sendXML); while (" &lt;includeFilterSets&gt; &lt;filterSet&gt; &lt;filter&gt; &lt;filterName&gt;VERSION_NAME&lt;/filterName&gt; &lt;operator&gt; &lt;name&gt;In&lt;/name&gt; &lt;/operator&gt; &lt;value&gt;10.0u&lt;/value&gt; &lt;/filter&gt; &lt;/filterSet&gt; &lt;/includeFilterSets&gt;") { } close XML; </code></pre> <p>I don't know what you would like to achieve with this, but it's not what you want to do. This snippet does the following:</p> <ul> <li>set <code>$test</code> to 'test'</li> <li>open a file handle to the filename in <code>$sendXML</code></li> <li>as long as the XML snippet is true, do nothing (this is always the case, thus infinite loop)</li> <li>the <code>close</code> is never reached.</li> </ul> <p>The rest of your code is ok.</p> <p>What you want to do is this. I've left out the filehandle stuff.</p> <pre><code>my $message = &lt;&lt;'XML'; &lt;includeFilterSets&gt; &lt;filterSet&gt; &lt;filter&gt; &lt;filterName&gt;VERSION_NAME&lt;/filterName&gt; &lt;operator&gt; &lt;name&gt;In&lt;/name&gt; &lt;/operator&gt; &lt;value&gt;10.0u&lt;/value&gt; &lt;/filter&gt; &lt;/filterSet&gt; &lt;/includeFilterSets&gt; XML my $webpage="http://example.com/"; my $ua = LWP::UserAgent-&gt;new; my $response = $ua-&gt;post($webpage, Content_Type =&gt; 'text/xml', Content =&gt; $message); if ($response-&gt;is_success) { print $response-&gt;decoded_content; # or whatever } else { die $response-&gt;status_line; } </code></pre> <hr> <p>One word of advice: Always <code>use strict</code> and <code>use warnings</code>, and look at three-argument opens and lexical filehandles. This will make your life a lot easier.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload