curl-library
Re: Muting Curl
From: Emannuel Silva <emsilva_at_gmail.com>
Date: Wed, 12 Jan 2005 23:55:15 -0200
Date: Wed, 12 Jan 2005 23:55:15 -0200
On Wed, 12 Jan 2005 23:30:56 +0100 (CET), Daniel Stenberg
<daniel-curl_at_haxx.se> wrote:
> On Wed, 12 Jan 2005, Emannuel Silva wrote:
> > Everytime I exec my perl script file, its going to go verbose on me.
> You mean it outputs all data and headers to stdout? Are you "taking care" of
> them the proper way then? (assuming that there is one, it's been a long while
> since I checked how the perl binding works)
Not all data. Only the headers. The page itself will only be displayed
if I "print @pg_source;" Let me paste a bit of my code here:
--- use WWW::Curl::easy; my $curl=WWW::Curl::easy->new() or die "curl init failed!\n"; $curl->setopt(CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); $curl->setopt(CURLOPT_URL, https://167.210.172.109/change/bin/files/wcls.asp"); $curl->setopt(CURLOPT_WRITEFUNCTION, \&body_callback); $curl->setopt(CURLOPT_FILE,\@pg_source); $curl->setopt(CURLOPT_COOKIEFILE,'pg_cookies'); $curl->perform(); --- Oh! Let me give away my &body_callback also: --- sub body_callback { my ($chunk,$context)=@_; push @{$context}, $chunk; return length($chunk); } --- After I perform "perl thisscript.pl", it sends the following to the stdout: --- HTTP/1.1 100 Continue Server: Microsoft-IIS/5.0 Date: Wed, 12 Jan 2005 14:49:52 GMT Location: https://167.210.172.109/change/bin/files/wcls.asp Content-Length: 121 Content-Type: text/html Expires: Wed, 12 Jan 2005 14:48:46 GMT Set-Cookie: ASPSESSIONIDSSTDSRSA=GJHGBDJAFMEAEFHCIAIKHEHL; path=/ Cache-control: private --- Any change I can remove that from my output? Thank you. Emannuel SilvaReceived on 2005-01-13