From: Bram Date: Wed, 6 Aug 2008 01:24:22 +0000 (-0700) Subject: [perl #57646] Weird non-equivalence between $::{'a'} = sub {} and *::a = sub {} X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8c44bff1ac2926fc059ca84c916a04461ff5ad01;p=p5sagit%2Fp5-mst-13.2.git [perl #57646] Weird non-equivalence between $::{'a'} = sub {} and *::a = sub {} From: "Bram via RT" Message-ID: p4raw-id: //depot/perl@34221 --- diff --git a/pod/perlmod.pod b/pod/perlmod.pod index 63f0be9..3d5f3ad 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -94,18 +94,9 @@ C<%main::>, or C<%::> for short. Likewise the symbol table for the nested package mentioned earlier is named C<%OUTER::INNER::>. The value in each entry of the hash is what you are referring to when you -use the C<*name> typeglob notation. In fact, the following have the same -effect, though the first is more efficient because it does the symbol -table lookups at compile time: +use the C<*name> typeglob notation. local *main::foo = *main::bar; - local $main::{foo} = $main::{bar}; - -(Be sure to note the B difference between the second line above -and C. The former is accessing the hash -C<%main::>, which is the symbol table of package C
. The latter is -simply assigning scalar C<$bar> in package C
to scalar C<$foo> of -the same package.) You can use this to print out all the variables in a package, for instance. The standard but antiquated F library and