【问题标题】:Can't figure out how to fix this script in perl无法弄清楚如何在 perl 中修复此脚本
【发布时间】:2012-12-09 20:12:26
【问题描述】:

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

【问题讨论】:

    标签: perl skype argv


    【解决方案1】:

    你有一个错字:

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

    应该是:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-10
      • 2014-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多