use Net::Telnet; 
$xml = "
<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>
<search>
	<searchservice>find</searchservice>
	<searchquery>Madonna</searchquery>
	<filetyp>(.mp3|.wav|.flac)</filetyp>
	<page>1</page>
	<clientversion>1.0.1</clientversion>
	<clientid>3434343434343434343434343434</clientid>
</search>
</xml>
";  
$telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die'); 
$telnet->open('localhost'); 
$telnet->print($xml);
































use IO::Socket;
 
$ip = "localhost";
$port = "###########";
$xml = "
<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>
<search>
	<searchservice>find</searchservice>
	<searchquery>Madonna</searchquery>
	<filetyp>(.mp3|.wav|.flac)</filetyp>
	<page>1</page>
	<clientversion>1.0.1</clientversion>
	<clientid>3434343434343434343434343434</clientid>
</search>
</xml>
";  
 
$socket = new IO::Socket::INET (
                                  PeerAddr  => $ip,
                                  PeerPort  => $port,
                                  Proto => 'tcp',
                               )                
or die "Keinen Server gefunden unter $ip:$port\n";
    
$socket->send($xml);
$socket->recv($recv_data,1024); 
print "Info: $recv_data\n";