我在 perl 中运行这个脚本并正确地输入了 id 和端口。但是,我不断收到“在第 16 行附近的运算符(operator)预期的位置找到标量”'skype://1024,'$ARGV”
#!usr/perl/bin
use LWP::UserAgent;
system("color a");
system("title Skype <<");
system("cls");
if(!$ARGV[0]||!$ARGV[1]) {
print q {
Usage : perl skype.pl [userid] [port=1024,80,433]
};
}
else {
use IO::Socket;
my $sock = new IO::Socket::INET (
PeerAddr => 'skype://'.$ARGV[0],
PeerPort => 'skype://1024,'$ARGV[1],
Proto => 'tcp',
);
die "Video Call Error: $!\n" unless $sock;
print $sock "skype://0x77656263616d5f647269766572\n";
system("start ".$sock);
}
# jvoid(document.write(document.currentUser.id));
最佳答案
你打错了:
PeerPort => 'skype://1024,'$ARGV[1],
应该是:
PeerPort => 'skype://1024,'.$ARGV[1],
# ^--- missing period
关于perl - 无法弄清楚如何在 perl 中修复此脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13791329/