NAME

WWW::CurlOO::Compat -- compatibility layer for WWW::Curl

SYNOPSIS

--- old.pl
+++ new.pl
@@ -2,6 +2,8 @@
 use strict;
 use warnings;

+# support both WWW::CurlOO (default) and WWW::Curl
+BEGIN { eval { require WWW::CurlOO::Compat; } }
 use WWW::Curl::Easy 4.15;
 use WWW::Curl::Multi;

DESCRIPTION

WWW::CurlOO::Compat lets you use WWW::CurlOO in applications and modules that normally use WWW::Curl. There are several ways to accomplish it:

EXECUTION

Execute an application through perl with -MWWW::CurlOO::Compat argument:

perl -MWWW::CurlOO::Compat APPLICATION [ARGUMENTS]

CODE, use WWW::CurlOO by default

Add this line before including any WWW::Curl modules:

BEGIN { eval { require WWW::CurlOO::Compat; } }

This will try to preload WWW::CurlOO, but won't fail if it isn't available.

CODE, use WWW::Curl by default

Add those lines before all the others that use WWW::Curl:

BEGIN {
    eval { require WWW::Curl; }
    require WWW::CurlOO::Compat if $@;
}

This will try WWW::Curl first, but will fallback to WWW::CurlOO if that fails.

NOTE

If you want to write compatible code, DO NOT USE WWW::CurlOO::Compat during development. This module hides all the incompatibilities, but does not disable any of the features that are unique to WWW::CurlOO. You could end up using methods that do not yet form part of official WWW::Curl distribution.

COPYRIGHT

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.