curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Identical call from Perl does not work

From: ToddAndMargo <ToddAndMargo_at_zoho.com>
Date: Fri, 31 May 2019 21:50:08 -0700

On 5/31/19 7:41 PM, ToddAndMargo wrote:
> Hi All,
>
> Fedora 30
> curl-7.64.0-6.fc30.x86_64
>
>
> I wrote a Perl 6 module that interfaces with curl.  If
> I send it "-v", its prints out the run string and
> the -v data as well.
>
> On this "one" site, I can not figure out why I can run the
> echo'ed command from the  command line but download an error
> report when running it from Perl.
>
> What the heck?
>
> -T

Figured it out.

I changes this line:

( $ReturnStr, $CurlStatus ) = CurlDownloadFile( "--referer
'http://www.almico.com/sfdownload.php'", "-v " ~ $ClickHere,
$NewFileName, %MaxTime<MaxTime4>, True );

to

( $ReturnStr, $CurlStatus ) = CurlDownloadFile( "--referer
http://www.almico.com/sfdownload.php", "-v " ~ $ClickHere, $NewFileName,
%MaxTime<MaxTime4>, True );

The mistake was the single qutoes around

       http://www.almico.com/sfdownload.php

And the reason it worked from the command line and not Perl
was that the command line was within the shell (bash)
and perl was running the command outside any shell.

Quotes used outside of the shell are pasted to the program
making curl think the quotes were part of the address.

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-06-01