perl - 无法弄清楚如何在 perl 中修复此脚本

标签 perl skype argv

我在 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/

相关文章:

perl - 安全地从信号处理程序访问共享数据结构

Perl - 将 IPv4 地址转换为十六进制

perl - Perl 如何解析打印 ""。 ($x, $y) ."\n"?

javascript - 防止浏览器失去对外部应用程序调用的关注

Perl:如何将 ARGV 参数传递给另一个脚本?

c - 如何从 main() 函数外部访问 argv[]?

perl - 如何将命名迭代器与后缀 foreach 一起使用?

delphi - 在监听套接字上接受监听套接字上的连接(并且不再监听)?

c# SendMessage 和 Skype 问题

c - 在 C 语言中,为什么 (while .. getchar()) 不写入我的文件?