develooper Front page | perl.perl5.porters | Postings from February 2000

[PATCH 5.5.660] double EXPORT_OK in h2xs

From:
Hugo
Date:
February 24, 2000 05:19
Subject:
[PATCH 5.5.660] double EXPORT_OK in h2xs
Message ID:
200002241324.NAA05900@crypt.compulink.co.uk
h2xs generates a .pm file with 'our @EXPORT_OK;' and, later,
"our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );". This patch removes
the initial declaration.

(I'm assuming the array doesn't need to be predeclared before the
'require Exporter;' - if it does, the 'our' should be removed from
the second use instead.)

Hugo
---
--- utils/h2xs.PL.old	Sun Jan 23 09:22:10 2000
+++ utils/h2xs.PL	Thu Feb 24 13:18:39 2000
@@ -634,18 +634,11 @@
 use strict;
 END
 
-if( $opt_X || $opt_c || $opt_A ){
-	# we won't have our own AUTOLOAD(), so won't have $AUTOLOAD
-	print PM <<'END';
-our @EXPORT_OK;
-END
-}
-else{
+unless( $opt_X || $opt_c || $opt_A ){
 	# we'll have an AUTOLOAD(), and it will have $AUTOLOAD and
 	# will want Carp.
 	print PM <<'END';
 use Carp;
-our @EXPORT_OK;
 END
 }
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About