cURL / Mailing Lists / curl-library / Single Mail


Re: Can't view strange Java URL with Curl. Is it possible?

From: Cris Bailiff <>
Date: Thu, 15 Nov 2001 10:47:23 +1100

Daniel Stenberg wrote:
> On Wed, 14 Nov 2001, Nick Chirca wrote:

> > I was just trying to a report a problem, to say that what the persons who
> > reported that he gets the HTML code altered is not the only one and that
> > I was facing the same problem.
> Yes, but you see it with the perl interface. I've not seen anyone report
> "data damage" using other interfaces (that weren't subsequently fixed or
> explained on user-error).

I didn't previously notice Nicks problem in the libcurl list, but I'll have to
say (as current, though rather distracted) maintainer of the perl interface, that
I've never seen libcurl or Curl::easy 'damage' any data.

I'm using Curl::easy/libcurl on thousands of requests for files of all types and
sizes (up to 100M+), across SSL and plain on linux and Solaris, with http keep
alives, and without and never had any problem at all. I'd notice if I did,
because a lot of our data is either zipped or pgp encrypted or signed rpms, all
of which would complain with a single bit out of place.

>From the bits of code I've seen in Nicks mail, I'd bee looking at some of the
usage of @rrays rather than $trings, as you can quickly fall foul of perls'
definition of lines and what 'print @rray' really means.

This is wrong for a start:

        print FILE "@array"

This will interpolate the array into the quoted string, which will use the output
record separator to print the array, which by default is ' '.

If you want to print the whole array, and just the array, use:

        print FILE @array;

or better still, I prefer to print plain strings, and be specific about what I'm

        print FILE join("",@array);

This would seem to be exactly Nicks problem from his description (which I just
searched back through the archive to find...):

> What's happening is that after I get the web content of the page in
> @body, I do:
> print G "@body"; #I print the content into a text file,
> but, at least one of the 10 lines I extract information from has an extra
> space (" ") into it.
> This line:
> <a href=" i?PartnerUsername=punkin
> suppose to be:
> <a href="verify_show_profiles.cgi?PartnerUsername=punkin

Hope this helps.....


Received on 2001-11-15