Perl问题.我试图让这个脚本在调试器中运行.
我在Windows 7x64上运行了Aptana + Epic + ActivePerl 5.12.4.脚本开始很好,但我收到一个错误:
curl -sS http://intranet.mycompany.org/directory/directory.xml
Run Code Online (Sandbox Code Playgroud)
上面的命令工作正常......但如果我启动调试器,我会收到此错误:
curl: (1) Protocol 'http not supported or disabled in libcurl
Run Code Online (Sandbox Code Playgroud)
下面脚本的第一部分:
#!/usr/bin/perl
use strict;
use XML::Parser;
use Data::Dumper;
my $url = 'http://intranet.atlanticgeneral.org/directory/directory.xml';
my $output = 'C:\global.gabook';
my $file = "curl -sS '$url' |";
my $parser = new XML::Parser(Style => 'Tree');
my $tree = $parser->parsefile($file)->[1];
Run Code Online (Sandbox Code Playgroud)
Stu*_*att 106
Windows不喜欢命令中的单引号.尝试使用qq {}转义命令在命令中使用双引号.只需更改一行:
my $file = qq{curl -sS "$url" |};
Run Code Online (Sandbox Code Playgroud)