-CSD太晚了

ast*_*ght 5 perl

试图从parsCit运行这个小的perl程序:

parsCit-client.pl e1.txt [filename]第1行的-CSD选项太迟了

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 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";
Run Code Online (Sandbox Code Playgroud)

TLP*_*TLP 8

来自perldoc perlrun,关于-C开关:

注意:从perl 5.10.1开始,如果在"#!"上使用-C选项 线,它必须在命令行上被指定为好,因为标准流在perl解释的执行这一点已经成立.您还可以使用binmode()来设置I/O流的编码.

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

换一种说法:

perl -CSD parsCit-client.pl 
Run Code Online (Sandbox Code Playgroud)