<?xml version="1.0" encoding="windows-1252"?>
<node id="574145" title="Re: No data received on client socket" created="2006-09-21 10:59:59" updated="2006-09-21 06:59:59">
<type id="11">
note</type>
<author id="56927">
rbi</author>
<data>
<field name="doctext">
I could finally get back the query result by modifying the  original script like this:

&lt;code&gt;
my $oSocket = IO::Socket::INET-&gt;new(PeerAddr =&gt; $HostName,            
+                                               
                                    PeerPort =&gt; $Port,                
+                                       
                                    Timeout =&gt; $SocketTimeout,
                                    Type =&gt; SOCK_STREAM);

my $sSend = "&lt;?xml version=\"1.0\"?&gt; &lt;request&gt;" .
"&lt;connectionstring&gt;" . $ConnectionString .
"&lt;/connectionstring&gt;" .
"&lt;sql&gt;&lt;![CDATA[" . $sSQL . "]]&gt;&lt;/sql&gt;&lt;/request&gt;";                     
+                         

local *FH = $oSocket;
print  FH $sSend;
while (&lt;FH&gt;) { print $_ };

&lt;/code&gt;

I'd really be grateful if someone can explain me what is not working in the other ways (my original one and the suggested modifications), and how the other ones should be modified in order to work.&lt;br&gt;

Thanks a lot.&lt;br&gt;&lt;br&gt;

&lt;b&gt;Update &lt;/b&gt; This way it works fine:&lt;br&gt;

&lt;code&gt;
...
local *FH = $oSocket;
print  FH $sSend;

while (1) {
    sysread($oSocket, $data_read, 4096,length($data_read));
    $sRet .= $data_read;
    last if ($data_read =~ /&lt;\/xml&gt;/i);

};
close (FH);
print $sRet;
&lt;/code&gt;

</field>
<field name="root_node">
573770</field>
<field name="parent_node">
573770</field>
</data>
</node>
