[EMAIL PROTECTED] wrote:
>On Sat, Jul 21, 2001 at 09:47:10PM -0500, Ken Williams wrote:
>> 2) I know MakeMaker has been around forever. Are you interested in
>> patches that help its readability, etc. without actually making any
>> changes?
>
>Yes, yes, yes! A thousand times, yes!
Perfect. Here's the first such patch, which mainly just adds
'use strict' to MakeMaker.pm and deals with its repercussions.
===========================================================================
--- lib/ExtUtils/MakeMaker-orig.pm Sat Jul 21 21:49:05 2001
+++ lib/ExtUtils/MakeMaker.pm Sat Jul 21 22:01:54 2001
@@ -1,14 +1,7 @@
package ExtUtils::MakeMaker;
-BEGIN {
- require 5.004
-}
-
-$VERSION = "5.47_01";
-$Version_OK = "5.17"; # Makefiles older than $Version_OK will die
- # (Will be checked from MakeMaker version 4.13 onwards)
-
-
+use strict;
+use 5.004;
require Exporter;
use Config;
use Carp ();
@@ -16,11 +9,17 @@
use vars qw(
@ISA @EXPORT @EXPORT_OK $AUTOLOAD
$ISA_TTY $Is_Mac $Is_OS2 $Is_VMS $Revision
+ $Is_Win32 $Is_Cygwin $Is_NetWare
+ $PACKNAME
$VERSION $Verbose $Version_OK %Config %Keep_after_flush
%MM_Sections %Prepend_dot_dot %Recognized_Att_Keys
@Get_from_Config @MM_Sections @Overridable @Parent
);
+$VERSION = "5.47_01";
+$Version_OK = "5.17"; # Makefiles older than $Version_OK will die
+ # (Will be checked from MakeMaker version 4.13 onwards)
+
#
# Set up the inheritance before we pull in the MM_* packages, because they
@@ -43,13 +42,8 @@
# Setup dummy package:
# MY exists for overriding methods to be defined within
#
-{
- package MY;
- @MY::ISA = qw(MM);
-### sub AUTOLOAD { use Devel::Symdump; print Devel::Symdump->rnew->as_string;
Carp::confess "hey why? $AUTOLOAD" }
- package MM;
- sub DESTROY {}
-}
+@MY::ISA = qw(MM);
+sub MM::DESTROY {}
# "predeclare the package: we only load it via AUTOLOAD
# but we have already mentioned it in @ISA
@@ -183,7 +177,7 @@
# package name for the classes into which the first object will be blessed
$PACKNAME = "PACK000";
- @Attrib_help = qw/
+ my @Attrib_help = qw/
AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION
C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS
@@ -386,6 +380,7 @@
mv_all_methods("MY",$newclass);
bless $self, $newclass;
push @Parent, $self;
+ no strict 'refs';
@{"$newclass\:\:ISA"} = 'MM';
}
@@ -657,7 +652,7 @@
sub mv_all_methods {
my($from,$to) = @_;
my($method);
- my($symtab) = \%{"${from}::"};
+ my($symtab) = do { no strict 'refs'; \%{"${from}::"} };
# no strict;
# Here you see the *current* list of methods that are overridable
@@ -817,7 +812,7 @@
my(@m);
if ($Verbose){
push @m, "\n# Full list of MakeMaker attribute values:";
- foreach $key (sort keys %$self){
+ foreach my $key (sort keys %$self){
next if $key eq 'RESULT' || $key =~ /^[A-Z][a-z]/;
my($v) = neatvalue($self->{$key});
$v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
===========================================================================
------------------- -------------------
Ken Williams Last Bastion of Euclidity
[EMAIL PROTECTED] The Math Forum