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

Wooble~

"I'm guessing it's the extra single quotes around $url that's causing it"

When I removed the quotes around the '$url' it worked. Quotes worked in redhat perl, but didn't work in my windows perl debugger:

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

Posting as answer since Wooble didn't.


I was getting the same error when I was using the curl command in my java program as follows

    String command = "curl 'http://google.com'";
     try
       {            
           Process proc = Runtime.getRuntime().exec(command);
        .......
        }catch(Exception e){}

Changing command to the following fixed this error

      String command = "curl http://google.com";

Actually, It may be an issue because of shell interpretor. I used curl command like below example

String command = "curl  -duser.name=hdfs -dexecute=select+*+from+logdata.test; -dstatusdir=test.output http://hostname:50111/templeton/v1/hive";

Windows doesn't like single quotes in commands. Try using double quotes in the command, using qq{} escaping. Just change one line:

my $file = qq{curl -sS "$url" |};

Tags:

Debugging

Perl