Perl:curl:(1)协议’http不支持或禁用libcurl

前端之家收集整理的这篇文章主要介绍了Perl:curl:(1)协议’http不支持或禁用libcurl前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图让这个脚本在调试器中运行。

我有Aptana Epic ActivePerl 5.12.4在Windows 7×64上工作。脚本开始正常,但我收到一个错误

curl -sS http://intranet.mycompany.org/directory/directory.xml

上面的命令工作正常…但如果我启动调试器,我得到这个错误

curl: (1) Protocol 'http not supported or disabled in libcurl

脚本的第一部分如下:

#!/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];

解决方法

Windows不喜欢命令中的单引号。尝试在命令中使用双引号,使用qq {}转义。只需更改一行:
my $file = qq{curl -sS "$url" |};
原文链接:https://www.f2er.com/Perl/173253.html

猜你在找的Perl相关文章