perlref: update bareword bracketing discussion, mention new auto-dereferencing
authorPhil Monsen <philip.monsen@pobox.com>
Sun, 10 Jul 2011 02:15:40 +0000 (21:15 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 10 Jul 2011 13:08:57 +0000 (06:08 -0700)
AUTHORS
pod/perlref.pod

diff --git a/AUTHORS b/AUTHORS
index ab608b5..b9de691 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -861,6 +861,7 @@ Peter Wolfe                 <wolfe@teloseng.com>
 Peter E. Yee                   <yee@trident.arc.nasa.gov> 
 Petter Reinholdtsen            <pere@hungry.com>
 Phil Lobbes                    <phil@perkpartners.com>
+Phil Monsen                    <philip.monsen@pobox.com>
 Philip Hazel                   <ph10@cus.cam.ac.uk>
 Philip M. Gollucci             <pgollucci@p6m7g8.com>
 Philip Newton                  <pne@cpan.org>
index f45a383..f1dffce 100644 (file)
@@ -51,6 +51,19 @@ scalar is holding a reference, it always behaves as a simple scalar.  It
 doesn't magically start being an array or hash or subroutine; you have to
 tell it explicitly to do so, by dereferencing it.
 
+References are easy to use in Perl.  There is just one overriding
+principle: in general, Perl does no implicit referencing or dereferencing.
+When a scalar is holding a reference, it always behaves as a simple scalar.
+It doesn't magically start being an array or hash or subroutine; you have to
+tell it explicitly to do so, by dereferencing it.
+
+That said, be aware that Perl version 5.14 introduces an exception
+to the rule, for syntactic convenience.  Experimental array and hash container
+function behavior allows array and hash references to be handled by Perl as
+if they had been explicitly syntactically dereferenced.  See
+L<perl5140delta/"Syntactical Enhancements">
+and L<perlfunc> for details.
+
 =head2 Making References
 X<reference, creation> X<referencing>
 
@@ -562,16 +575,16 @@ variables, which are all "global" to the package.
 
 =head2 Not-so-symbolic references
 
-A new feature contributing to readability in perl version 5.001 is that the
-brackets around a symbolic reference behave more like quotes, just as they
-always have within a string.  That is,
+Since Perl verion 5.001, brackets around a symbolic reference can simply
+serve to isolate an identifier or variable name from the rest of an
+expression, just as they always have within a string.  For example,
 
     $push = "pop on ";
     print "${push}over";
 
 has always meant to print "pop on over", even though push is
-a reserved word.  This has been generalized to work the same outside
-of quotes, so that
+a reserved word.  In 5.001, this was generalized to work the same
+without the enclosing double quotes, so that
 
     print ${push} . "over";
 
@@ -588,9 +601,9 @@ using strict refs:
     ${ bareword };     # Okay, means $bareword.
     ${ "bareword" };   # Error, symbolic reference.
 
-Similarly, because of all the subscripting that is done using single
-words, we've applied the same rule to any bareword that is used for
-subscripting a hash.  So now, instead of writing
+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
 
     $array{ "aaa" }{ "bbb" }{ "ccc" }