This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Call a hash %hash in the documentation
authorE. Choroba <choroba@cpan.org>
Wed, 5 Dec 2018 22:49:57 +0000 (23:49 +0100)
committerTony Cook <tony@develop-help.com>
Mon, 10 Dec 2018 23:53:39 +0000 (10:53 +1100)
Previously, %array was used which was confusing.

pod/perlref.pod

index cf36922..4982b65 100644 (file)
@@ -603,23 +603,23 @@ Similarly, because of all the subscripting that is done using single words,
 the same rule applies to any bareword that is used for subscripting a hash.
 So now, instead of writing
 
 the same rule applies to any bareword that is used for subscripting a hash.
 So now, instead of writing
 
-    $array{ "aaa" }{ "bbb" }{ "ccc" }
+    $hash{ "aaa" }{ "bbb" }{ "ccc" }
 
 you can write just
 
 
 you can write just
 
-    $array{ aaa }{ bbb }{ ccc }
+    $hash{ aaa }{ bbb }{ ccc }
 
 and not worry about whether the subscripts are reserved words.  In the
 rare event that you do wish to do something like
 
 
 and not worry about whether the subscripts are reserved words.  In the
 rare event that you do wish to do something like
 
-    $array{ shift }
+    $hash{ shift }
 
 you can force interpretation as a reserved word by adding anything that
 makes it more than a bareword:
 
 
 you can force interpretation as a reserved word by adding anything that
 makes it more than a bareword:
 
-    $array{ shift() }
-    $array{ +shift }
-    $array{ shift @_ }
+    $hash{ shift() }
+    $hash{ +shift }
+    $hash{ shift @_ }
 
 The C<use warnings> pragma or the B<-w> switch will warn you if it
 interprets a reserved word as a string.
 
 The C<use warnings> pragma or the B<-w> switch will warn you if it
 interprets a reserved word as a string.