加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl – -CSD太晚了

发布时间:2020-12-15 21:46:50 所属栏目:大数据 来源:网络整理
导读:试图从parsCit运行这个小的perl程序: parsCit-client.pl e1.txt Too late for -CSD option at [filename] line 1 e1.txt在这里:http://dl.dropbox.com/u/10557283/parserProj/e1.txt 我从win7 cmd运行程序,而不是Cygwin. filename是parsCit-client.pl –
试图从parsCit运行这个小的perl程序:

parsCit-client.pl e1.txt
Too late for -CSD option at [filename] line 1

e1.txt在这里:http://dl.dropbox.com/u/10557283/parserProj/e1.txt

我从win7 cmd运行程序,而不是Cygwin.

filename是parsCit-client.pl – 整个程序在这里:

#!/usr/bin/perl -CSD
#
# Simple SOAP client for the ParsCit web service.
#
# Isaac Councill,07/24/07
#
use strict;
use encoding 'utf8';
use utf8;
use SOAP::Lite +trace=>'debug';
use MIME::Base64;
use FindBin;

my $textFile = $ARGV[0];
my $repositoryID = $ARGV[1];

if (!defined $textFile || !defined $repositoryID) {
    print "Usage: $0 textFile repositoryIDn".
    "Specify "LOCAL" as repository if using local file system.n";
    exit;
}

my $wsdl = "$FindBin::Bin/../wsdl/ParsCit.wsdl";

my $parsCitService = SOAP::Lite
    ->service("file:$wsdl")
    ->on_fault(
           sub {
           my($soap,$res) = @_;
           die ref $res ? $res->faultstring :
               $soap->transport->status;
           });

my ($citations,$citeFile,$bodyFile) =
    $parsCitService->extractCitations($textFile,$repositoryID);

#print "$citationsn";
#print "CITEFILE: $citeFilen";
#print "BODYFILE: $bodyFilen";

解决方法

从 perldoc perlrun开始,关于-C开关:

Note: Since perl 5.10.1,if the -C option is used on the “#!” line,it
must be specified on the command line as well
,since the standard
streams are already set up at this point in the execution of the perl
interpreter. You can also use binmode() to set the encoding of an I/O
stream.

这大概就是编译器所说的“为时已晚”.

换一种说法:

perl -CSD parsCit-client.pl

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读