2

我在 perl 中运行这个脚本并正确输入 id 和端口。但是,我不断收到“标量在第 16 行附近的操作员预期的位置”'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));
4

1 回答 1

6

你有一个错字:

PeerPort => 'skype://1024,'$ARGV[1],

应该:

PeerPort => 'skype://1024,'.$ARGV[1],
           #               ^--- missing period
于 2012-12-09T20:15:53.460 回答