cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problem of executing Curl via Perl (web-based)

From: Chadwick Leung <poleetea_at_hotmail.com>
Date: Mon, 28 Nov 2005 06:50:17 +0000

Hi there,

I cannot execute Curl by using Perl.

I have written a web-form in Perl. The program read data from the web-form
and format the data into a CURL string which is output to a file (SHELL
script).

The SHELL file is in mode 711 contain the CURL string, such as:

#!/bin/sh

/usr/local/bin/curl -3 -u username:password -d
"STRING1=string1&STRING2=string2"
https://web.domain.com.hk?INFO+NEW_ACCOUNT+OK

In command prompt (Unix), the Curl string can be executed successfully even
can be run by executing the SHELL file.

I tried executing the SHELL file in Perl in the followings two ways but none
of it works:
system ("sh shell.sh");
`sh shell.sh`;

I did some troubleshooting with the following codes:

@return = `curl http://www.somewhere.com`;

foreach (@return) {
        print "$_<p>\n";
}

There is no return. So I think the problem is in Curl.

The Curl command is in mode 755. I don't know whether there is any
configuration to Curl to make it can be called from Web.

Any idea?
Received on 2005-11-28