求高手翻译perl脚本语言
时间:2011-07-04
来源:互联网
sub sendMessage
{
my $tricomIP ="111.222.217.235";
my $port=10000;
my $phone=12345678;
if (!$tricomIP)
{
print "please input remote server running tricom!\n";
print "Usage: $0 <remote_server_hostname_or_ip>\n";
exit 0;
}
print "\$tricomIP=$tricomIP\n";
my $console = new Net::Telnet(Timeout=>180);
$console->open(Host=>$tricomIP,Port=>$port);
unless($console->waitfor(String=>'Welcome to Tricom',Timeout=>5))#waiting for the welcome message from server
{
print "Please startup the remote server first!\n";
exit;
}
for(;;)
{
$console->print("at\n");
if($console->waitfor(String=>'OK',Timeout=>5))
{
print "'OK' comes! sms modem is working.\n";
last;
}
else
{
print "'OK' does not come! please check sms modem.\n";
}
sleep(1);
}
$console->print("at+CMGF=1\n");
sleep(1);
for(;;)
{
$console->print("at+CMGS=\"$phone\"\n");
sleep(1);
$console->print(@_);
$console->print("\n");
sleep(1);
$console->print("`");
$console->print("\n");
if($console->waitfor(String=>'OK',Timeout=>5))
{
print "'OK' comes! message is sent successful.\n";
last;
}
else
{
print "'OK' does not come! message is not sent successful.\n";
}
sleep(1);
}
}#end of sub
这是一段perl脚本语言,由于小弟没有接触过,所以请求高手将它翻译成vc的语言,万分感谢!
{
my $tricomIP ="111.222.217.235";
my $port=10000;
my $phone=12345678;
if (!$tricomIP)
{
print "please input remote server running tricom!\n";
print "Usage: $0 <remote_server_hostname_or_ip>\n";
exit 0;
}
print "\$tricomIP=$tricomIP\n";
my $console = new Net::Telnet(Timeout=>180);
$console->open(Host=>$tricomIP,Port=>$port);
unless($console->waitfor(String=>'Welcome to Tricom',Timeout=>5))#waiting for the welcome message from server
{
print "Please startup the remote server first!\n";
exit;
}
for(;;)
{
$console->print("at\n");
if($console->waitfor(String=>'OK',Timeout=>5))
{
print "'OK' comes! sms modem is working.\n";
last;
}
else
{
print "'OK' does not come! please check sms modem.\n";
}
sleep(1);
}
$console->print("at+CMGF=1\n");
sleep(1);
for(;;)
{
$console->print("at+CMGS=\"$phone\"\n");
sleep(1);
$console->print(@_);
$console->print("\n");
sleep(1);
$console->print("`");
$console->print("\n");
if($console->waitfor(String=>'OK',Timeout=>5))
{
print "'OK' comes! message is sent successful.\n";
last;
}
else
{
print "'OK' does not come! message is not sent successful.\n";
}
sleep(1);
}
}#end of sub
这是一段perl脚本语言,由于小弟没有接触过,所以请求高手将它翻译成vc的语言,万分感谢!
作者: tonywei57 发布时间: 2011-07-04
有依赖模块,翻译不了。你为啥要翻译成VC的?
另外你要只是想看懂,自己先找本Perl书看比较好。代码本身没什么复杂度。
另外你要只是想看懂,自己先找本Perl书看比较好。代码本身没什么复杂度。
作者: iambic 发布时间: 2011-07-04
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28