r62284 - in /branches/upstream/libwww-curl-perl/current: ./ lib/WWW/ lib/WWW/Curl/ t/ template/

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Thu Sep 2 06:01:27 UTC 2010


Author: carnil-guest
Date: Thu Sep  2 06:00:59 2010
New Revision: 62284

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62284
Log:
[svn-upgrade] new version libwww-curl-perl (4.13)

Added:
    branches/upstream/libwww-curl-perl/current/t/20undefined_subs.t
Modified:
    branches/upstream/libwww-curl-perl/current/Changes
    branches/upstream/libwww-curl-perl/current/Curl.xs
    branches/upstream/libwww-curl-perl/current/MANIFEST
    branches/upstream/libwww-curl-perl/current/META.yml
    branches/upstream/libwww-curl-perl/current/Makefile.PL
    branches/upstream/libwww-curl-perl/current/README
    branches/upstream/libwww-curl-perl/current/SIGNATURE
    branches/upstream/libwww-curl-perl/current/lib/WWW/Curl.pm
    branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Easy.pm
    branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Form.pm
    branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Share.pm
    branches/upstream/libwww-curl-perl/current/template/Easy.pm.tmpl
    branches/upstream/libwww-curl-perl/current/template/Share.pm.tmpl

Modified: branches/upstream/libwww-curl-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/Changes?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/Changes (original)
+++ branches/upstream/libwww-curl-perl/current/Changes Thu Sep  2 06:00:59 2010
@@ -1,4 +1,11 @@
 Revision history for the Perl binding of libcurl, WWW::Curl.
+4.13 Wed Sep 01 2010: - Balint Szilakszi <szbalint at cpan.org>
+
+    - Fixed WWW::Curl::Form (again, formadd and formaddfile working now).
+    - Made constant constant handling more robust and added tests [Fuji, Goro].
+    - Modernized *.pm and AUTOLOAD now throws an error on unknown method calls [Fuji, Goro].
+    - Fixed code depending on CURLINFO_SLIST to be optional [Fuji, Goro].
+
 4.12 Sun Jun 04 2010: - Balint Szilakszi <szbalint at cpan.org>
 
     - Fixed WWW::Curl::Form (patch contributed by Michael Ing).

Modified: branches/upstream/libwww-curl-perl/current/Curl.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/Curl.xs?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/Curl.xs (original)
+++ branches/upstream/libwww-curl-perl/current/Curl.xs Thu Sep  2 06:00:59 2010
@@ -280,9 +280,8 @@
     void *call_function,
     void *call_ctx)
 {
-    dSP;
-
     if (call_function) { /* We are doing a callback to perl */
+        dSP;
         int count, status;
 
         ENTER;
@@ -587,9 +586,8 @@
 PROTOTYPES: ENABLE
 
 int
-constant(name,arg)
+constant(name)
     char * name
-    int arg
 
 
 void
@@ -908,6 +906,7 @@
                 RETVAL = newSVnv(vdouble);
                 break;
             }
+#ifdef CURLINFO_SLIST
             case CURLINFO_SLIST:
             {
                 struct curl_slist *vlist, *entry;
@@ -924,6 +923,7 @@
                 RETVAL = newRV(sv_2mortal((SV *) items));
                 break;
             }
+#endif /* CURLINFO_SLIST */
             default: {
                 RETVAL = newSViv(CURLE_BAD_FUNCTION_ARGUMENT);
                 break;
@@ -976,9 +976,8 @@
 MODULE = WWW::Curl    PACKAGE = WWW::Curl::Form    PREFIX = curl_form_
 
 int
-constant(name,arg)
+constant(name)
     char * name
-    int arg
 
 void
 curl_form_new(...)
@@ -1000,7 +999,7 @@
         XSRETURN(1);
 
 void
-curl_formadd(self,name,value)
+curl_form_formadd(self,name,value)
     WWW::Curl::Form self
     char *name
     char *value
@@ -1011,7 +1010,7 @@
             CURLFORM_END); 
 
 void
-curl_formaddfile(self,filename,description,type)
+curl_form_formaddfile(self,filename,description,type)
     WWW::Curl::Form self
     char *filename
     char *description
@@ -1193,9 +1192,8 @@
 PROTOTYPES: ENABLE
 
 int
-constant(name,arg)
+constant(name)
     char * name
-    int arg
 
 void
 curl_share_new(...)

Modified: branches/upstream/libwww-curl-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/MANIFEST?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/MANIFEST (original)
+++ branches/upstream/libwww-curl-perl/current/MANIFEST Thu Sep  2 06:00:59 2010
@@ -36,6 +36,7 @@
 t/17slist.t
 t/18twinhandles.t
 t/19multi.t
+t/20undefined_subs.t
 t/meta.t
 t/new/00constants.t
 t/new/01basic.t

Modified: branches/upstream/libwww-curl-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/META.yml?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/META.yml (original)
+++ branches/upstream/libwww-curl-perl/current/META.yml Thu Sep  2 06:00:59 2010
@@ -24,4 +24,4 @@
   perl: 5.6.1
 resources:
   repository: http://github.com/szbalint/WWW--Curl
-version: 4.12
+version: 4.13

Modified: branches/upstream/libwww-curl-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/Makefile.PL?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/Makefile.PL (original)
+++ branches/upstream/libwww-curl-perl/current/Makefile.PL Thu Sep  2 06:00:59 2010
@@ -131,7 +131,7 @@
     # boilerplate xs constant function here
     print CURL_XS <<HERE
 static int
-constant(char *name, int arg)
+constant(const char *name)
 {
     errno = 0;
 HERE

Modified: branches/upstream/libwww-curl-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/README?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/README (original)
+++ branches/upstream/libwww-curl-perl/current/README Thu Sep  2 06:00:59 2010
@@ -24,7 +24,7 @@
 
 Minimum version requirements:
 
-This module, starting from version 4 requires at least Perl 5.6 and libcurl 7.10.8.
+This module, starting from version 4 requires at least Perl 5.6.1 and libcurl 7.10.8.
 These releases are more than 5 years old and they have multiple security vulnerabilities,
 it is advised that you upgrade as soon as possible to a more recent, secure version.
 Anything older than these versions of Perl and libcurl respectively is not supported.
@@ -58,7 +58,7 @@
 
 The source code repository is available at http://github.com/szbalint/WWW--Curl/tree .
  
-Copyright (C) 2000-2005, 2008-2009 Daniel Stenberg, Cris Bailiff, Bálint Szilakszi, et al.  
+Copyright (C) 2000-2005, 2008-2010 Daniel Stenberg, Cris Bailiff, Bálint Szilakszi, et al.  
 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 

Modified: branches/upstream/libwww-curl-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/SIGNATURE?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/SIGNATURE (original)
+++ branches/upstream/libwww-curl-perl/current/SIGNATURE Thu Sep  2 06:00:59 2010
@@ -14,13 +14,13 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA256
 
-SHA1 e5832a6de950df4208e57c3b5ce5978e867df5df Changes
-SHA1 cc58e04a4fb86d0ad8ef6abb882b515648ef4c9e Curl.xs
+SHA1 57dd37a044ec3932167e144e5c6243530c659c8e Changes
+SHA1 a5b3c8d879c0a839e1950c9f6f46d82ebe806e4f Curl.xs
 SHA1 94cbea5b3fb940e25cd4535d1c81bfd7d51dac3c LICENSE
-SHA1 a33cdbb8996d5b8dfc92da6d34e7327ebde1b1c5 MANIFEST
-SHA1 6455def3635ae5d2c55e853a61f7c21acc6637d6 META.yml
-SHA1 bf0ea5c3c087f69376656276fffea8524b02323f Makefile.PL
-SHA1 a21d7184f91692fb3d6d7175e4a526f9d99fe3c7 README
+SHA1 8685dd652f68b7283809bf28a6d5478ed6f6c19a MANIFEST
+SHA1 929ba34ad51060a0aac41ce7f2114bc68b444988 META.yml
+SHA1 754b95eb93ec7fb5d0922e7030742fc0de1f196b Makefile.PL
+SHA1 3e8bbd9aa6cd273aef05f78cfef0116a0e3d59b0 README
 SHA1 ed6f9f399075307a33bd02902ebbadbbbfbd8bab README.Win32
 SHA1 fd5f3c4f0418efee3b9b16cf8c3902e8374909df inc/Module/Install.pm
 SHA1 7cd7c349afdf3f012e475507b1017bdfa796bfbd inc/Module/Install/Base.pm
@@ -29,11 +29,11 @@
 SHA1 dbec1085a29a855202ee797a5bac319cf426827f inc/Module/Install/MakeMaker.pm
 SHA1 3e83972921d54198d1246f7278f08664006cd65d inc/Module/Install/Makefile.pm
 SHA1 12bf1867955480d47d5171a9e9c6a96fabe0b58f inc/Module/Install/Metadata.pm
-SHA1 5d57332dcfd0ee1be67873be520d4371e7bf7262 lib/WWW/Curl.pm
-SHA1 6c3fd8228370ae898e4e0fefcc280aeea9c097fe lib/WWW/Curl/Easy.pm
-SHA1 7ff51363b45f28c4fabc5888c64515eb7f450ae6 lib/WWW/Curl/Form.pm
+SHA1 2080f924fe9ec9c2852fcb9657967ff98b2bb78f lib/WWW/Curl.pm
+SHA1 d6a5f950e177856a7d4e93484652784f15cb303a lib/WWW/Curl/Easy.pm
+SHA1 e1693d1264812c85800b61a2131f1822ec7c54a7 lib/WWW/Curl/Form.pm
 SHA1 0bddc700447a50dd26d13119ee60349556ce1811 lib/WWW/Curl/Multi.pm
-SHA1 bcf4bc64399691f1871b9592ced73ce5fef86fea lib/WWW/Curl/Share.pm
+SHA1 08df49894fc724e358676a80ca7cd3895bc30b9a lib/WWW/Curl/Share.pm
 SHA1 802cb1fcd35fe78e4cdb10164a05e54ce1427543 t/00constants.t
 SHA1 88c7780f18aab350318bd8c6d887558a4ce17519 t/01basic.t
 SHA1 07b63b1baca142a0e34e79633d0eb57684524bed t/02callbacks.t
@@ -51,6 +51,7 @@
 SHA1 e784a874eb36fd5b16a12fc58365cce697ecbbab t/17slist.t
 SHA1 9b80d6de1675261d43abea2f76cfd610f42a4494 t/18twinhandles.t
 SHA1 7c7e12a6a5afa9afaec967958e1396d41f2697c8 t/19multi.t
+SHA1 42f7f35d7ac8b38838cc71fdc7a89402b63e01b7 t/20undefined_subs.t
 SHA1 2924361d0713031b92c6b888f11e860d357837f7 t/meta.t
 SHA1 3cd20c1711b43058550922404f53a844fb2695e6 t/new/00constants.t
 SHA1 d9863d2e71f618a58d419534867cda8bd97dcfbf t/new/01basic.t
@@ -66,13 +67,13 @@
 SHA1 20ec0bd03ff2600505d38623153a6eb3087b5814 t/new/README
 SHA1 ac25bfa56d36f19cbee72a968b06372e88602a61 t/pod-coverage.t
 SHA1 0190346d7072d458c8a10a45c19f86db641dcc48 t/pod.t
-SHA1 6333c54cd70480a71e628e49c42551624f151f68 template/Easy.pm.tmpl
-SHA1 b4841adcad866b70d9d72f171d3d0f8f9d5b3c79 template/Share.pm.tmpl
+SHA1 79c2627afc7d7671fbd545527a19a9622fcd8f11 template/Easy.pm.tmpl
+SHA1 f690cca3adf6c17840985fe40c22ee56fdfb999f template/Share.pm.tmpl
 SHA1 468b011caaf4d54609b421027d7c6262a9260e89 typemap
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
-iF4EAREIAAYFAkwxBuEACgkQ9vEeIen/Zj5PcQEAhQQMhnYTxSPbAfJpQEzgkAKb
-OOmfT+ee84HR9sSr1akBAKE6L1eHzwf+WrrT2wLTHfTQfuP8OyYt6eM1Vw4Duvmj
-=T9bp
+iF4EAREIAAYFAkx+x+0ACgkQ9vEeIen/Zj6WxwD/VfQCOWg+9egne6NNWMllAE0j
+i+i7r/CAEaQWywuXU7YBAIJnxLu9qN0XUqm/Xuxj6cd4YBofXhsQseXjAHMPc82d
+=0s0r
 -----END PGP SIGNATURE-----

Modified: branches/upstream/libwww-curl-perl/current/lib/WWW/Curl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/lib/WWW/Curl.pm?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/lib/WWW/Curl.pm (original)
+++ branches/upstream/libwww-curl-perl/current/lib/WWW/Curl.pm Thu Sep  2 06:00:59 2010
@@ -2,14 +2,10 @@
 
 use strict;
 use warnings;
-use vars qw(@ISA $VERSION);
-use DynaLoader;
-
-BEGIN {
-    $VERSION = '4.12';
-    @ISA     = qw(DynaLoader);
-    __PACKAGE__->bootstrap;
-}
+use XSLoader;
+
+our $VERSION = '4.13';
+XSLoader::load(__PACKAGE__, $VERSION);
 
 END {
     _global_cleanup();
@@ -173,8 +169,8 @@
 
     use WWW::Curl::Form;
     my $curlf = WWW::Curl::Form->new;
-    $curlf->curl_formaddfile($filename, 'attachment', "multipart/form-data");
-    $curlf->curl_formadd("FIELDNAME", "VALUE");
+    $curlf->formaddfile($filename, 'attachment', "multipart/form-data");
+    $curlf->formadd("FIELDNAME", "VALUE");
 
     $curl->setopt(CURLOPT_HTTPPOST, $curlf);
 
@@ -245,8 +241,8 @@
 
 =item curl_formfree
 
-When WWW::Curl::Form support is added, this function will be used internally,
-but won't be accessible from the public API.
+Used internally. Not exposed through the public API, as this call has no relevance
+to Perl code.
 
 =item curl_free
 

Modified: branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Easy.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Easy.pm?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Easy.pm (original)
+++ branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Easy.pm Thu Sep  2 06:00:59 2010
@@ -3,21 +3,19 @@
 use strict;
 use warnings;
 use Carp;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
 
-$VERSION = '4.12';
+our $VERSION = '4.13';
 
-require WWW::Curl;
-require Exporter;
-require AutoLoader;
+use WWW::Curl ();
+use Exporter  ();
 
- at ISA = qw(Exporter DynaLoader);
+our @ISA = qw(Exporter);
 
 # Items to export into callers namespace by default. Note: do not export
 # names by default without a very good reason. Use EXPORT_OK instead.
 # Do not simply export all your public functions/methods/constants.
 
- at EXPORT = qw(
+our @EXPORT = qw(
 );
 
 $WWW::Curl::Easy::headers = "";
@@ -25,16 +23,25 @@
 
 sub const_string {
 	my ($self, $constant) = @_;
-	return constant($constant,0);
+	return constant($constant);
 }
 
 sub AUTOLOAD {
-
+    our $AUTOLOAD;
     # This AUTOLOAD is used to 'autoload' constants from the constant()
     # XS function.
 
     ( my $constname = $AUTOLOAD ) =~ s/.*:://;
-    return constant( $constname, 0 );
+    my $value = constant( $constname );
+    if($!) {
+        croak("Undefined subroutine &$AUTOLOAD called");
+    }
+
+    {
+        no strict 'refs';
+        *{$AUTOLOAD} = sub { $value };
+    }
+    return $value;
 }
 
 1;

Modified: branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Form.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Form.pm?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Form.pm (original)
+++ branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Form.pm Thu Sep  2 06:00:59 2010
@@ -1,29 +1,37 @@
 package WWW::Curl::Form;
 use strict;
 use warnings;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+use Carp;
 
-$VERSION = '4.12';
+our $VERSION = '4.13';
 
-require WWW::Curl;
-require Exporter;
-require AutoLoader;
+use WWW::Curl ();
+use Exporter  ();
 
- at ISA = qw(Exporter DynaLoader);
+our @ISA = qw(Exporter);
 
- at EXPORT = qw(
+our @EXPORT = qw(
 CURLFORM_FILE
 CURLFORM_COPYNAME
 CURLFORM_CONTENTTYPE
 );
 
 sub AUTOLOAD {
-
+    our $AUTOLOAD;
     # This AUTOLOAD is used to 'autoload' constants from the constant()
     # XS function.
 
     ( my $constname = $AUTOLOAD ) =~ s/.*:://;
-    return constant( $constname, 0 );
+    my $value = constant( $constname );
+    if($!) {
+        croak("Undefined subroutine &$AUTOLOAD caclled");
+    }
+
+    {
+        no strict 'refs';
+        *{$AUTOLOAD} = sub { $value };
+    }
+    return $value;
 }
 
 1;

Modified: branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Share.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Share.pm?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Share.pm (original)
+++ branches/upstream/libwww-curl-perl/current/lib/WWW/Curl/Share.pm Thu Sep  2 06:00:59 2010
@@ -3,24 +3,31 @@
 use strict;
 use warnings;
 use Carp;
-use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
 
-use WWW::Curl;
-require Exporter;
-require AutoLoader;
+use WWW::Curl ();
+use Exporter  ();
 
- at ISA = qw(Exporter DynaLoader);
+our @ISA = qw(Exporter);
 
- at EXPORT = qw(
+our @EXPORT = qw(
 );
 
 sub AUTOLOAD {
-
+    our $AUTOLOAD;
     # This AUTOLOAD is used to 'autoload' constants from the constant()
     # XS function.
 
     ( my $constname = $AUTOLOAD ) =~ s/.*:://;
-    return constant( $constname, 0 );
+    my $value = constant( $constname );
+    if($!) {
+        croak("Undefined subroutine &$AUTOLOAD failed");
+    }
+
+    {
+        no strict 'refs';
+        *{$AUTOLOAD} = sub { $value };
+    }
+    return $value;
 }
 
 1;

Added: branches/upstream/libwww-curl-perl/current/t/20undefined_subs.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/t/20undefined_subs.t?rev=62284&op=file
==============================================================================
--- branches/upstream/libwww-curl-perl/current/t/20undefined_subs.t (added)
+++ branches/upstream/libwww-curl-perl/current/t/20undefined_subs.t Thu Sep  2 06:00:59 2010
@@ -1,0 +1,20 @@
+#!perl -w
+use strict;
+use Test::More tests => 4;
+
+use WWW::Curl::Easy;
+use WWW::Curl::Share;
+use WWW::Curl::Multi;
+use WWW::Curl::Form;
+
+eval { WWW::Curl::Easy->no_such_method0 };
+like $@, qr/\b no_such_method0 \b/xms;
+
+eval { WWW::Curl::Share->no_such_method1 };
+like $@, qr/\b no_such_method1 \b/xms;
+
+eval { WWW::Curl::Multi->no_such_method2 };
+like $@, qr/\b no_such_method2 \b/xms;
+
+eval { WWW::Curl::Form->no_such_method3 };
+like $@, qr/\b no_such_method3 \b/xms;

Modified: branches/upstream/libwww-curl-perl/current/template/Easy.pm.tmpl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/template/Easy.pm.tmpl?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/template/Easy.pm.tmpl (original)
+++ branches/upstream/libwww-curl-perl/current/template/Easy.pm.tmpl Thu Sep  2 06:00:59 2010
@@ -3,21 +3,19 @@
 use strict;
 use warnings;
 use Carp;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
 
-$VERSION = '4.12';
+our $VERSION = '4.13';
 
-require WWW::Curl;
-require Exporter;
-require AutoLoader;
+use WWW::Curl ();
+use Exporter  ();
 
- at ISA = qw(Exporter DynaLoader);
+our @ISA = qw(Exporter);
 
 # Items to export into callers namespace by default. Note: do not export
 # names by default without a very good reason. Use EXPORT_OK instead.
 # Do not simply export all your public functions/methods/constants.
 
- at EXPORT = qw(
+our @EXPORT = qw(
 @CURLOPT_INCLUDE@
 );
 
@@ -26,16 +24,25 @@
 
 sub const_string {
 	my ($self, $constant) = @_;
-	return constant($constant,0);
+	return constant($constant);
 }
 
 sub AUTOLOAD {
-
+    our $AUTOLOAD;
     # This AUTOLOAD is used to 'autoload' constants from the constant()
     # XS function.
 
     ( my $constname = $AUTOLOAD ) =~ s/.*:://;
-    return constant( $constname, 0 );
+    my $value = constant( $constname );
+    if($!) {
+        croak("Undefined subroutine &$AUTOLOAD called");
+    }
+
+    {
+        no strict 'refs';
+        *{$AUTOLOAD} = sub { $value };
+    }
+    return $value;
 }
 
 1;

Modified: branches/upstream/libwww-curl-perl/current/template/Share.pm.tmpl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-curl-perl/current/template/Share.pm.tmpl?rev=62284&op=diff
==============================================================================
--- branches/upstream/libwww-curl-perl/current/template/Share.pm.tmpl (original)
+++ branches/upstream/libwww-curl-perl/current/template/Share.pm.tmpl Thu Sep  2 06:00:59 2010
@@ -3,25 +3,32 @@
 use strict;
 use warnings;
 use Carp;
-use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
 
-use WWW::Curl;
-require Exporter;
-require AutoLoader;
+use WWW::Curl ();
+use Exporter  ();
 
- at ISA = qw(Exporter DynaLoader);
+our @ISA = qw(Exporter);
 
- at EXPORT = qw(
+our @EXPORT = qw(
 @CURLSHOPT_INCLUDE@
 );
 
 sub AUTOLOAD {
-
+    our $AUTOLOAD;
     # This AUTOLOAD is used to 'autoload' constants from the constant()
     # XS function.
 
     ( my $constname = $AUTOLOAD ) =~ s/.*:://;
-    return constant( $constname, 0 );
+    my $value = constant( $constname );
+    if($!) {
+        croak("Undefined subroutine &$AUTOLOAD failed");
+    }
+
+    {
+        no strict 'refs';
+        *{$AUTOLOAD} = sub { $value };
+    }
+    return $value;
 }
 
 1;




More information about the Pkg-perl-cvs-commits mailing list