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

时间:2012-12-09 20:12:27

标签: perl skype argv

我在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));

1 个答案:

答案 0 :(得分:6)

你有一个错字:

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

应该是:

PeerPort => 'skype://1024,'.$ARGV[1],
           #               ^--- missing period