gpt4 book ai didi

perl - -CSD 为时已晚

转载 作者:行者123 更新时间:2023-12-04 17:25:54 25 4
gpt4 key购买 nike

尝试从 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。

文件名是 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 repositoryID\n".
"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 "$citations\n";
#print "CITEFILE: $citeFile\n";
#print "BODYFILE: $bodyFile\n";

最佳答案

来自 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 

关于perl - -CSD 为时已晚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9780604/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com