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

[PATCH: perl@8102] s/use vars qw\(/our(/ for OS/390 extension builds

Thread Next
From:
Peter Prymmer
Date:
December 14, 2000 15:47
Subject:
[PATCH: perl@8102] s/use vars qw\(/our(/ for OS/390 extension builds
Message ID:
Pine.OSF.4.10.10012141548200.57557-100000@aspara.forte.com

The build of the @8102 kit on OS/390 currently dies with:

cat ext/re/re.pm > lib/re.pm
./miniperl configpm configpm.tmp
sh mv-if-diff configpm.tmp lib/Config.pm
        AutoSplitting perl library
./miniperl -Ilib -e 'use AutoSplit; \
autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
Global symbol "$VERSION" requires explicit package name at lib/File/Spec.pm line 6.
Global symbol "@ISA" requires explicit package name at lib/File/Spec.pm line 16.
Compilation failed in require at lib/File/Spec/Functions.pm line 3.
BEGIN failed--compilation aborted at lib/File/Spec/Functions.pm line 3.
Compilation failed in require at lib/AutoSplit.pm line 9.
BEGIN failed--compilation aborted at lib/AutoSplit.pm line 9.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
make: *** [preplibrary] Error 255

Basically because C<use vars qw($VARIABLE @LIST);> no longer works on
OS/390.

Here is a patch that does not fix the but but does affect the following
files:

 `perl/ext/Errno/Errno_pm.PL'
 `perl/lib/ExtUtils/Manifest.pm'
 `perl/lib/ExtUtils/MM_Unix.pm'
 `perl/lib/File/Spec/Functions.pm'
 `perl/lib/File/Spec/Unix.pm'
 `perl/lib/File/Spec.pm'

that does an effective s/use vars qw/our/ in lots of places.
From the obsolesence and deprecation warnings in the pod for vars.pm
I presume that this is an OK thing to do to the mentioned lib files.

The downside is that there is still a bug with the combination of 
C<use strict;> and C<use vars qw($var);> on OS/390.  In looking at vars.pm
I didn't encounter a problem with the C<($ch, $sym) = unpack('a1a*', $sym);>
line on EBCDIC and I am currently suspicious that we have a problem with 
the $^H variable, perhaps owing to a coded character set issue.

Rest assured that this patch does not hide the lingering bug since there 
are still a good many tests that show that C<use vars LIST> no longer heads
off trouble with C<use strict;> on OS/390.  Indeed with this patch I obtain
only an approximate 71% test passage rate.  But I also tested this patch 
on OSF/1 4.0D and obtained:

 All tests successful.
 u=0.816667  s=1.25  cu=116.3  cs=37.7667  scripts=273  tests=14453

So here it is:

diff -ru perl.8102.orig/ext/Errno/Errno_pm.PL perl/ext/Errno/Errno_pm.PL
--- perl.8102.orig/ext/Errno/Errno_pm.PL	Mon Dec 11 19:30:07 2000
+++ perl/ext/Errno/Errno_pm.PL	Thu Dec 14 13:30:48 2000
@@ -2,9 +2,7 @@
 use Config;
 use strict;
 
-use vars qw($VERSION);
-
-$VERSION = "1.111";
+our $VERSION = "1.111";
 
 my %err = ();
 
@@ -185,7 +183,7 @@
 #
 
 package Errno;
-use vars qw(\@EXPORT_OK \%EXPORT_TAGS \@ISA \$VERSION \%errno \$AUTOLOAD);
+our (\@EXPORT_OK,\%EXPORT_TAGS,\@ISA,\$VERSION,\%errno,\$AUTOLOAD);
 use Exporter ();
 use Config;
 use strict;
diff -ru perl.8102.orig/lib/ExtUtils/Manifest.pm perl/lib/ExtUtils/Manifest.pm
--- perl.8102.orig/lib/ExtUtils/Manifest.pm	Mon Dec 11 19:30:43 2000
+++ perl/lib/ExtUtils/Manifest.pm	Thu Dec 14 13:30:33 2000
@@ -8,8 +8,8 @@
 use Carp;
 use strict;
 
-use vars qw($VERSION @ISA @EXPORT_OK
-	    $Is_VMS $Debug $Verbose $Quiet $MANIFEST $found $DEFAULT_MSKIP);
+our ($VERSION,@ISA,@EXPORT_OK,
+	    $Is_VMS,$Debug,$Verbose,$Quiet,$MANIFEST,$found,$DEFAULT_MSKIP);
 
 $VERSION = substr(q$Revision: 1.33 $, 10);
 @ISA=('Exporter');
diff -ru perl.8102.orig/lib/ExtUtils/MM_Unix.pm perl/lib/ExtUtils/MM_Unix.pm
--- perl.8102.orig/lib/ExtUtils/MM_Unix.pm	Mon Dec 11 19:30:42 2000
+++ perl/lib/ExtUtils/MM_Unix.pm	Thu Dec 14 13:30:13 2000
@@ -7,8 +7,8 @@
 use File::Basename qw(basename dirname fileparse);
 use DirHandle;
 use strict;
-use vars qw($VERSION $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_PERL_OBJECT
-	    $Verbose %pm %static $Xsubpp_Version);
+our ($Is_Mac,$Is_OS2,$Is_VMS,$Is_Win32,$Is_Dos,$Is_PERL_OBJECT,
+	    $Verbose,%pm,%static,$Xsubpp_Version);
 
 our $VERSION = '1.12603';
 
diff -ru perl.8102.orig/lib/File/Spec/Functions.pm perl/lib/File/Spec/Functions.pm
--- perl.8102.orig/lib/File/Spec/Functions.pm	Mon Dec 11 19:30:44 2000
+++ perl/lib/File/Spec/Functions.pm	Thu Dec 14 13:29:57 2000
@@ -3,7 +3,7 @@
 use File::Spec;
 use strict;
 
-use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
+our (@ISA,@EXPORT,@EXPORT_OK,%EXPORT_TAGS,$VERSION);
 
 $VERSION = '1.1';
 
diff -ru perl.8102.orig/lib/File/Spec/Unix.pm perl/lib/File/Spec/Unix.pm
--- perl.8102.orig/lib/File/Spec/Unix.pm	Mon Dec 11 19:30:44 2000
+++ perl/lib/File/Spec/Unix.pm	Thu Dec 14 13:29:26 2000
@@ -1,7 +1,7 @@
 package File::Spec::Unix;
 
 use strict;
-use vars qw($VERSION);
+our($VERSION);
 
 $VERSION = '1.2';
 
diff -ru perl.8102.orig/lib/File/Spec.pm perl/lib/File/Spec.pm
--- perl.8102.orig/lib/File/Spec.pm	Mon Dec 11 19:30:44 2000
+++ perl/lib/File/Spec.pm	Thu Dec 14 13:29:11 2000
@@ -1,7 +1,7 @@
 package File::Spec;
 
 use strict;
-use vars qw(@ISA $VERSION);
+our(@ISA, $VERSION);
 
 $VERSION = 0.82 ;
 
End of Patch.

Peter Prymmer





Thread Next


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