r62286 - in /trunk/libwww-curl-perl: ./ debian/ 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:08:10 UTC 2010


Author: carnil-guest
Date: Thu Sep  2 06:07:57 2010
New Revision: 62286

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62286
Log:
* New upstream release
* Add myself to Uploaders.

Added:
    trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm
    trunk/libwww-curl-perl/t/20undefined_subs.t
      - copied unchanged from r62285, branches/upstream/libwww-curl-perl/current/t/20undefined_subs.t
Modified:
    trunk/libwww-curl-perl/Changes
    trunk/libwww-curl-perl/Curl.xs
    trunk/libwww-curl-perl/MANIFEST
    trunk/libwww-curl-perl/META.yml
    trunk/libwww-curl-perl/Makefile.PL
    trunk/libwww-curl-perl/README
    trunk/libwww-curl-perl/SIGNATURE
    trunk/libwww-curl-perl/debian/changelog
    trunk/libwww-curl-perl/debian/control
    trunk/libwww-curl-perl/lib/WWW/Curl.pm
    trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm
    trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm
    trunk/libwww-curl-perl/template/Easy.pm.tmpl
    trunk/libwww-curl-perl/template/Share.pm.tmpl

Modified: trunk/libwww-curl-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/Changes?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/Changes (original)
+++ trunk/libwww-curl-perl/Changes Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/Curl.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/Curl.xs?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/Curl.xs (original)
+++ trunk/libwww-curl-perl/Curl.xs Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/MANIFEST?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/MANIFEST (original)
+++ trunk/libwww-curl-perl/MANIFEST Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/META.yml?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/META.yml (original)
+++ trunk/libwww-curl-perl/META.yml Thu Sep  2 06:07:57 2010
@@ -24,4 +24,4 @@
   perl: 5.6.1
 resources:
   repository: http://github.com/szbalint/WWW--Curl
-version: 4.12
+version: 4.13

Modified: trunk/libwww-curl-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/Makefile.PL?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/Makefile.PL (original)
+++ trunk/libwww-curl-perl/Makefile.PL Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/README?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/README (original)
+++ trunk/libwww-curl-perl/README Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/SIGNATURE?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/SIGNATURE (original)
+++ trunk/libwww-curl-perl/SIGNATURE Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/debian/changelog?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/debian/changelog (original)
+++ trunk/libwww-curl-perl/debian/changelog Thu Sep  2 06:07:57 2010
@@ -1,3 +1,10 @@
+libwww-curl-perl (4.13-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Add myself to Uploaders.
+
+ -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Thu, 02 Sep 2010 08:07:52 +0200
+
 libwww-curl-perl (4.12-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libwww-curl-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/debian/control?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/debian/control (original)
+++ trunk/libwww-curl-perl/debian/control Thu Sep  2 06:07:57 2010
@@ -7,7 +7,8 @@
 Uploaders: Niko Tyni <ntyni at iki.fi>, Jose Luis Rivas <ghostbar38 at gmail.com>,
  Martín Ferrari <tincho at debian.org>, gregor herrmann <gregoa at debian.org>,
  Ryan Niebur <ryan at debian.org>, Jonathan Yu <jawnsy at cpan.org>,
- Nathan Handler <nhandler at ubuntu.com>, Ansgar Burchardt <ansgar at 43-1.org>
+ Nathan Handler <nhandler at ubuntu.com>, Ansgar Burchardt <ansgar at 43-1.org>,
+ Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
 Standards-Version: 3.9.0
 Homepage: http://curl.haxx.se/libcurl/perl/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-curl-perl/

Modified: trunk/libwww-curl-perl/lib/WWW/Curl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl.pm?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl.pm (original)
+++ trunk/libwww-curl-perl/lib/WWW/Curl.pm Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm (original)
+++ trunk/libwww-curl-perl/lib/WWW/Curl/Easy.pm Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm (original)
+++ trunk/libwww-curl-perl/lib/WWW/Curl/Form.pm Thu Sep  2 06:07:57 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;

Added: trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm?rev=62286&op=file
==============================================================================
--- trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm (added)
+++ trunk/libwww-curl-perl/lib/WWW/Curl/Share.pm Thu Sep  2 06:07:57 2010
@@ -1,0 +1,42 @@
+package WWW::Curl::Share;
+
+use strict;
+use warnings;
+use Carp;
+
+use WWW::Curl ();
+use Exporter  ();
+
+our @ISA = qw(Exporter);
+
+our @EXPORT = qw(
+);
+
+sub AUTOLOAD {
+    our $AUTOLOAD;
+    # This AUTOLOAD is used to 'autoload' constants from the constant()
+    # XS function.
+
+    ( my $constname = $AUTOLOAD ) =~ s/.*:://;
+    my $value = constant( $constname );
+    if($!) {
+        croak("Undefined subroutine &$AUTOLOAD failed");
+    }
+
+    {
+        no strict 'refs';
+        *{$AUTOLOAD} = sub { $value };
+    }
+    return $value;
+}
+
+1;
+__END__
+
+
+Copyright (C) 2008, Anton Fedorov (datacompboy <at> mail.ru)
+
+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.

Modified: trunk/libwww-curl-perl/template/Easy.pm.tmpl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/template/Easy.pm.tmpl?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/template/Easy.pm.tmpl (original)
+++ trunk/libwww-curl-perl/template/Easy.pm.tmpl Thu Sep  2 06:07:57 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: trunk/libwww-curl-perl/template/Share.pm.tmpl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-curl-perl/template/Share.pm.tmpl?rev=62286&op=diff
==============================================================================
--- trunk/libwww-curl-perl/template/Share.pm.tmpl (original)
+++ trunk/libwww-curl-perl/template/Share.pm.tmpl Thu Sep  2 06:07:57 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