cURL / Mailing Lists / curl-users / Single Mail

curl-users

SV: Problem of executing Curl via Perl (web-based)

From: jeremiah <jeremiah_at_easywebsite.se>
Date: Mon, 28 Nov 2005 11:12:39 +0100

-----Ursprungligt meddelande-----
Från: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se] För Chadwick Leung
Skickat: den 28 november 2005 07:50
Till: curl-users_at_cool.haxx.se
Ämne: Problem of executing Curl via Perl (web-based)

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:

Try chmod'ng the script to 755

#!/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?

You can call curl from with a perl script directly or a shell script
directly, it seems from the above snippets that you are mixing the two
syntaxes. Post your entire script so we can look and perhaps post it to a
Shell or perl mailing list as well.

jeremiah
Received on 2005-11-28