Net::Curl::Share - Perl interface for curl_share_* functions
use Net::Curl::Share qw(:constants); my $share = Net::Curl::Share->new(); $share->setopt( CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE ); $share->setopt( CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS ); $easy_one->setopt( CURLOPT_SHARE() => $share ); $easy_two->setopt( CURLOPT_SHARE() => $share );
This module wraps share handle from libcurl and all related functions and constants. It does not export by default anything, but constants can be exported upon request.
use Net::Curl::Share qw(:constants);
Creates new Net::Curl::Share object. If BASE is specified it will be used as object base, otherwise an empty hash will be used. BASE must be a valid reference which has not been blessed already. It will not be used by the object.
my $share = Net::Curl::Share->new( [qw(my very private data)] );
Set an option. OPTION is a numeric value, use one of CURLSHOPT_* constants. VALUE depends on whatever that option expects.
$share->setopt( CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE );
None of those functions are exported, you must use fully qualified names.
Return a string for error code CODE.
my $message = Net::Curl::Share::strerror( CURLSHE_BAD_OPTION );
See curl_share_strerror(3) for more info.
Values for setopt().
Values passed to lock callbacks. Unused.
Values passed to lock and unlock callbacks. Unused.
Values used to enable/disable shareing.
Reffer to libcurl documentation for more detailed info on each of those.
Not supported. Locking is done internally.
Not supported. (Un)Locking is done internally.
Net::Curl::Share setopt method on failure throws a Net::Curl::Share::Code error object. It has both numeric value and, when used as string, it calls strerror() function to display a nice message.
Copyright (c) 2011 Przemyslaw Iskra <sparky at pld-linux.org>.
You may opt to use, copy, modify, merge, publish, distribute and/or sell copies of the Software, and permit persons to whom the Software is furnished to do so, under the terms of the MPL or the MIT/X-derivate licenses. You may pick one of these licenses.