curl-users
error: AUTOLOAD... CURLOPT... deprecated?
Date: Mon, 28 Jun 2004 15:40:07 -0500
I just had my server upgraded, and in the process a newer version of curl installed, which promptly broke my script.
Basically I get a lot of messages telling me "Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_HEADER() is deprecated.." How can I fix this? The relevant code and complete errors are below.
<start my code>
$curl->setopt(CURLOPT_HEADER, 1);
$curl->setopt(CURLOPT_POST, 1);
$curl->setopt(CURLOPT_POSTFIELDS, $datapost);
$curl->setopt(CURLOPT_MUTE, 1);
$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
$curl->setopt(CURLOPT_TIMEOUT, 30);
open HEAD, ">head.out";
$curl->setopt(CURLOPT_WRITEHEADER, *HEAD);
open BODY, ">body.out";
$curl->setopt(CURLOPT_FILE,*BODY);
$curl->setopt(CURLOPT_URL, $url);
my $header_called=0;
sub header_callback {
$header_called=1; return length($_[0])
};
$curl->setopt(CURLOPT_HEADERFUNCTION, \&header_callback);
my $body_called=0;
my $chunk;
my $auth_response;
sub body_callback {
my ($chunk,$handle)=@_;
$auth_response .= $chunk;
$body_called++;
return length($chunk); # OK
}
my $body_ref=\&body_callback;
$curl->setopt(CURLOPT_WRITEFUNCTION, $body_ref);
</end my code>
<errors>
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_HEADER() is deprecated at r_auth.cgi line 130.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_POST() is deprecated at r_auth.cgi line 131.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_POSTFIELDS() is deprecated at r_auth.cgi line 132.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_MUTE() is deprecated at r_auth.cgi line 133.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_FOLLOWLOCATION() isdeprecated at r_auth.cgi line 134.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_TIMEOUT() is deprecated at r_auth.cgi line 135.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_WRITEHEADER() is deprecated at r_auth.cgi line 138.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_FILE() is deprecated at r_auth.cgi line 141.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_URL() is deprecatedat r_auth.cgi line 143.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_HEADERFUNCTION() isdeprecated at r_auth.cgi line 157.
Use of inherited AUTOLOAD for non-method Curl::easy::CURLOPT_WRITEFUNCTION() isdeprecated at r_auth.cgi line 173.
</errors>
Chris Ryan
OnTheBrightSide.com
Received on 2004-06-28