Change 30272 by [EMAIL PROTECTED] on 2007/02/13 23:24:02
Integrate:
[ 29736]
Make opcode.pl strict and warnings clean.
[ 29738]
Make autodoc.pl strict clean.
[ 29739]
Make keywords.pl strict and warnings clean.
[ 29740]
Make makedef.pl warnings and strict clean.
[ 29741]
Make minimod.pl warnings and strict clean.
[ 29742]
Subject: ./miniperl minimod.pl ... Can't locate strict.pm
From: [EMAIL PROTECTED] (Andreas J. Koenig)
Date: Wed, 10 Jan 2007 04:55:55 +0100
Message-ID: <[EMAIL PROTECTED]>
[ 29774]
makedef.pl should be able to load "strict"
Affected files ...
... //depot/maint-5.8/perl/autodoc.pl#15 integrate
... //depot/maint-5.8/perl/keywords.pl#12 integrate
... //depot/maint-5.8/perl/makedef.pl#40 integrate
... //depot/maint-5.8/perl/minimod.pl#3 integrate
... //depot/maint-5.8/perl/opcode.pl#33 integrate
Differences ...
==== //depot/maint-5.8/perl/autodoc.pl#15 (text) ====
Index: perl/autodoc.pl
--- perl/autodoc.pl#14~29721~ 2007-01-08 07:51:22.000000000 -0800
+++ perl/autodoc.pl 2007-02-13 15:24:02.000000000 -0800
@@ -8,6 +8,7 @@
require 'regen_lib.pl';
}
+use strict;
#
# See database of global and static function prototypes in embed.fnc
@@ -218,7 +219,7 @@
warn "Unable to place $_!\n";
}
-readonly_header(DOC);
+readonly_header(\*DOC);
print DOC <<'_EOB_';
=head1 NAME
@@ -277,7 +278,7 @@
_EOE_
-readonly_footer(DOC);
+readonly_footer(\*DOC);
close(DOC) or die "Error closing pod/perlapi.pod: $!";
@@ -285,7 +286,7 @@
open(GUTS, ">pod/perlintern.pod") or
die "Unable to create pod/perlintern.pod: $!\n";
binmode GUTS;
-readonly_header(GUTS);
+readonly_header(\*GUTS);
print GUTS <<'END';
=head1 NAME
@@ -324,6 +325,6 @@
perlguts(1), perlapi(1)
END
-readonly_footer(GUTS);
+readonly_footer(\*GUTS);
close GUTS or die "Error closing pod/perlintern.pod: $!";
==== //depot/maint-5.8/perl/keywords.pl#12 (xtext) ====
Index: perl/keywords.pl
--- perl/keywords.pl#11~29725~ 2007-01-08 14:09:41.000000000 -0800
+++ perl/keywords.pl 2007-02-13 15:24:02.000000000 -0800
@@ -1,4 +1,5 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
+use strict;
require 'regen_lib.pl';
safer_unlink ("keywords.h");
@@ -25,12 +26,12 @@
# Read & print data.
-$keynum = 0;
+my $keynum = 0;
while (<DATA>) {
chop;
next unless $_;
next if /^#/;
- ($keyword) = split;
+ my ($keyword) = split;
print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
}
@@ -40,7 +41,7 @@
###########################################################################
sub tab {
- local($l, $t) = @_;
+ my ($l, $t) = @_;
$t .= "\t" x ($l - (length($t) + 1) / 8);
$t;
}
==== //depot/maint-5.8/perl/makedef.pl#40 (text) ====
Index: perl/makedef.pl
--- perl/makedef.pl#39~30269~ 2007-02-13 13:18:26.000000000 -0800
+++ perl/makedef.pl 2007-02-13 15:24:02.000000000 -0800
@@ -1,3 +1,4 @@
+#./perl -w
#
# Create the export list for perl.
#
@@ -8,8 +9,12 @@
# reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h
# On OS/2 reads miniperl.map and the previous version of perl5.def as well
-my $PLATFORM;
-my $CCTYPE;
+BEGIN { unshift @INC, "lib" }
+use strict;
+
+use vars qw($PLATFORM $CCTYPE $FILETYPE $CONFIG_ARGS $ARCHNAME $PATCHLEVEL);
+
+my (%define, %ordinal);
while (@ARGV) {
my $flag = shift;
@@ -153,7 +158,7 @@
print STDERR "Defines: (" . join(' ', sort keys %define) . ")\n";
if ($PLATFORM =~ /^win(?:32|ce)$/) {
- ($dll = ($define{PERL_DLL} || "perl58")) =~ s/\.dll$//i;
+ (my $dll = ($define{PERL_DLL} || "perl58")) =~ s/\.dll$//i;
print "LIBRARY $dll\n";
print "DESCRIPTION 'Perl interpreter'\n";
print "EXPORTS\n";
@@ -177,11 +182,11 @@
}
$sym_ord < $_ and $sym_ord = $_ for values %ordinal; # Take the max
}
- ($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/;
+ (my $v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/;
$v .= '-thread' if $ARCHNAME =~ /-thread/;
- ($dll = $define{PERL_DLL}) =~ s/\.dll$//i;
+ (my $dll = $define{PERL_DLL}) =~ s/\.dll$//i;
$v .= "[EMAIL PROTECTED]" if $PATCHLEVEL;
- $d = "DESCRIPTION '[EMAIL PROTECTED]@perl.org:$v#\@ Perl interpreter,
configured as $CONFIG_ARGS'";
+ my $d = "DESCRIPTION '[EMAIL PROTECTED]@perl.org:$v#\@ Perl interpreter,
configured as $CONFIG_ARGS'";
$d = substr($d, 0, 249) . "...'" if length $d > 253;
print <<"---EOP---";
LIBRARY '$dll' INITINSTANCE TERMINSTANCE
@@ -193,9 +198,9 @@
---EOP---
}
elsif ($PLATFORM eq 'aix') {
- $OSVER = `uname -v`;
+ my $OSVER = `uname -v`;
chop $OSVER;
- $OSREL = `uname -r`;
+ my $OSREL = `uname -r`;
chop $OSREL;
if ($OSVER > 4 || ($OSVER == 4 && $OSREL >= 3)) {
print "#! ..\n";
@@ -1278,6 +1283,7 @@
}
}
elsif ($PLATFORM eq 'os2') {
+ my (%mapped, @missing);
open MAP, 'miniperl.map' or die 'Cannot read miniperl.map';
/^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>;
close MAP or die 'Cannot close miniperl.map';
==== //depot/maint-5.8/perl/minimod.pl#3 (text) ====
Index: perl/minimod.pl
--- perl/minimod.pl#2~25425~ 2005-09-17 04:45:57.000000000 -0700
+++ perl/minimod.pl 2007-02-13 15:24:02.000000000 -0800
@@ -1,4 +1,5 @@
-# minimod.PL writes the contents of miniperlmain.c into the module
+#./miniperl -w
+# minimod.pl writes the contents of miniperlmain.c into the module
# ExtUtils::Miniperl for later perusal (when the perl source is
# deleted)
#
@@ -10,6 +11,10 @@
#
# Version 1.0, Feb 2nd 1995 by Andreas Koenig
+BEGIN { unshift @INC, "lib" }
+
+use strict;
+
print <<'END';
# This File keeps the contents of miniperlmain.c.
#
==== //depot/maint-5.8/perl/opcode.pl#33 (xtext) ====
Index: perl/opcode.pl
--- perl/opcode.pl#32~30194~ 2007-02-10 10:07:51.000000000 -0800
+++ perl/opcode.pl 2007-02-13 15:24:02.000000000 -0800
@@ -1,11 +1,13 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
+use strict;
+
BEGIN {
# Get function prototypes
require 'regen_lib.pl';
}
-$opcode_new = 'opcode.h-new';
-$opname_new = 'opnames.h-new';
+my $opcode_new = 'opcode.h-new';
+my $opname_new = 'opnames.h-new';
open(OC, ">$opcode_new") || die "Can't create $opcode_new: $!\n";
binmode OC;
open(ON, ">$opname_new") || die "Can't create $opname_new: $!\n";
@@ -14,11 +16,15 @@
# Read data.
+my %seen;
+my (@ops, %desc, %check, %ckname, %flags, %args);
+
while (<DATA>) {
chop;
next unless $_;
next if /^#/;
- ($key, $desc, $check, $flags, $args) = split(/\t+/, $_, 5);
+ my ($key, $desc, $check, $flags, $args) = split(/\t+/, $_, 5);
+ $args = '' unless defined $args;
warn qq[Description "$desc" duplicates $seen{$desc}\n] if $seen{$desc};
die qq[Opcode "$key" duplicates $seen{$key}\n] if $seen{$key};
@@ -91,7 +97,6 @@
# Emit defines.
-$i = 0;
print <<"END";
/* -*- buffer-read-only: t -*-
*
@@ -137,6 +142,7 @@
typedef enum opcode {
END
+my $i = 0;
for (@ops) {
print ON "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
}
@@ -276,17 +282,17 @@
EXT U32 PL_opargs[] = {
END
-%argnum = (
- S, 1, # scalar
- L, 2, # list
- A, 3, # array value
- H, 4, # hash value
- C, 5, # code value
- F, 6, # file value
- R, 7, # scalar reference
+my %argnum = (
+ 'S', 1, # scalar
+ 'L', 2, # list
+ 'A', 3, # array value
+ 'H', 4, # hash value
+ 'C', 5, # code value
+ 'F', 6, # file value
+ 'R', 7, # scalar reference
);
-%opclass = (
+my %opclass = (
'0', 0, # baseop
'1', 1, # unop
'2', 2, # binop
@@ -307,8 +313,8 @@
my %OP_IS_FILETEST;
for (@ops) {
- $argsum = 0;
- $flags = $flags{$_};
+ my $argsum = 0;
+ my $flags = $flags{$_};
$argsum |= 1 if $flags =~ /m/; # needs stack mark
$argsum |= 2 if $flags =~ /f/; # fold constants
$argsum |= 4 if $flags =~ /s/; # always produces scalar
@@ -320,13 +326,13 @@
$argsum |= 128 if $flags =~ /u/; # defaults to $_
$flags =~ /([\W\d_])/ or die qq[Opcode "$_" has no class indicator];
$argsum |= $opclass{$1} << 9;
- $mul = 0x2000; # 2 ^ OASHIFT
- for $arg (split(' ',$args{$_})) {
+ my $mul = 0x2000; # 2 ^ OASHIFT
+ for my $arg (split(' ',$args{$_})) {
if ($arg =~ /^F/) {
$OP_IS_SOCKET{$_} = 1 if $arg =~ s/s//;
$OP_IS_FILETEST{$_} = 1 if $arg =~ s/-//;
}
- $argnum = ($arg =~ s/\?//) ? 8 : 0;
+ my $argnum = ($arg =~ s/\?//) ? 8 : 0;
die "op = $_, arg = $arg\n" unless length($arg) == 1;
$argnum += $argnum{$arg};
warn "# Conflicting bit 32 for '$_'.\n"
@@ -371,8 +377,8 @@
safer_rename $opcode_new, 'opcode.h';
safer_rename $opname_new, 'opnames.h';
-$pp_proto_new = 'pp_proto.h-new';
-$pp_sym_new = 'pp.sym-new';
+my $pp_proto_new = 'pp_proto.h-new';
+my $pp_sym_new = 'pp.sym-new';
open PP, ">$pp_proto_new" or die "Error creating $pp_proto_new: $!";
binmode PP;
@@ -433,7 +439,7 @@
###########################################################################
sub tab {
- local($l, $t) = @_;
+ my ($l, $t) = @_;
$t .= "\t" x ($l - (length($t) + 1) / 8);
$t;
}
End of Patch.