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

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

发布时间:2020-12-15 21:23:13 所属栏目:大数据 来源:网络整理
导读:我试图让这个脚本在调试器中运行。 我有Aptana Epic ActivePerl 5.12.4在Windows 7×64上工作。脚本开始正常,但我收到一个错误: curl -sS http://intranet.mycompany.org/directory/directory.xml 上面的命令工作正常…但如果我启动调试器,我得到这个错误
我试图让这个脚本在调试器中运行。

我有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" |};

(编辑:李大同)

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

    推荐文章
      热点阅读