perl 5.003_06: lib/Symbol.pm
Perl 5 Porters [Fri, 20 Sep 1996 14:08:33 +0000 (15:08 +0100)]
Date: Fri, 20 Sep 1996 12:38:14 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Symbol.pm clobbers $_ at startup

  perl -le 'BEGIN {$_="foo";} use Symbol; print qualify($_)'

I don't understand why the module want to initialize %global from
<DATA> in the first place.  Perhaps we want to apply this patch
instead.

Date: Fri, 20 Sep 1996 15:08:33 +0100 (BST)
From: "Joseph S. Myers" <jsm28@hermes.cam.ac.uk>
Subject: Pod typos, pod2man bugs, and miscellaneous installation comments

Here is a patch for various typos and other defects in the Perl
5.003_05 pods, including the pods embedded in library modules.

lib/Symbol.pm

index 67808af..75d1dfb 100644 (file)
@@ -34,7 +34,7 @@ support anonymous globs, C<Symbol::ungensym> is also provided.
 But it doesn't do anything.
 
 C<Symbol::qualify> turns unqualified symbol names into qualified
-variable names (e.g. "myvar" -> "MyPackage::myvar").  If it is given a
+variable names (e.g. "myvar" -E<gt> "MyPackage::myvar").  If it is given a
 second parameter, C<qualify> uses it as the default package;
 otherwise, it uses the package of its caller.  Regardless, global
 variable names (e.g. "STDOUT", "ENV", "SIG") are always qualfied with
@@ -56,12 +56,7 @@ require Exporter;
 my $genpkg = "Symbol::";
 my $genseq = 0;
 
-my %global;
-while (<DATA>) {
-    chomp;
-    $global{$_} = 1;
-}
-close DATA;
+my %global = map {$_ => 1} qw(ARGV ARGVOUT ENV INC SIG STDERR STDIN STDOUT);
 
 sub gensym () {
     my $name = "GEN" . $genseq++;
@@ -88,13 +83,3 @@ sub qualify ($;$) {
 }
 
 1;
-
-__DATA__
-ARGV
-ARGVOUT
-ENV
-INC
-SIG
-STDERR
-STDIN
-STDOUT