cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 28 Nov 2005 08:11:58 +0100 (CET)

On Mon, 28 Nov 2005, Chadwick Leung wrote:

> I cannot execute Curl by using Perl.

Then you do something wrong!

> 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).

You mean you invoke this from a web server? Then I would say that the most
likely reason for this failure is a difference in evironment.

> 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.

A failure does not produce anything on stdout so of course those command lines
show nothing if they have the same error your original program has.

Run 'strace curl' instead and store its output to see what causes it to fail.
Or just use curl as you do but make very sure to store and show the text that
appears on stderr.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-11-28