Собсно на пхп то все пучком, мне нужно на перле это сделать, скока запросов и поисков не делал в гугл и яндых так и не воткнул

Вот что на пхп:
Код: Выделить всё
#!/usr/local/php/bin/php
<?php
$text="Hello бойз энд гёрлс";
$smstext = iconv ('koi8-r', 'utf-8', $text);
$str = "<?xml version='1.0' encoding='UTF-8'?>
<data>
<login>my_login</login>
<password>here_password</password>
<action>send</action>
<text>".$smstext."</text>
<to number='7xxxxxxxxxx'></to>
</data>";
$url = "https://go-to-sms.com:7214/send.xml";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, $str); // add POST fields
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
curl_close($ch);
header ("Content-type: text/plain");
//echo $result;
?>
Код: Выделить всё
#!/usr/bin/perl -w
use strict;
use LWP;
use HTTP::Request::Common;
my $ua = LWP::UserAgent->new();
$ua->agent("PerlUA/0.1");
my $url = "https://go-to-sms.com:7214/send.xml";
my $request = POST $url;
my $document = $ua->request($request);
if ($document->is_success)
{
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
print "<data>\n";
print "<login>Login</login>\n";
print "<password>password</password>\n";
print "<action>send</action>\n";
print "<text>TEXT</text>\n";
print "<to number='+7xxxxxxxxx'></to>\n";
print "</data>\n";
}
exit(0);