applied patch, with indentation tweaks
[p5sagit/p5-mst-13.2.git] / pod / perlref.pod
index 6aa0860..34c071f 100644 (file)
@@ -15,9 +15,9 @@ hashes, hashes of arrays, arrays of hashes of functions, and so on.
 
 Hard references are smart--they keep track of reference counts for you,
 automatically freeing the thing referred to when its reference count goes
-to zero.  (Note: The reference counts for values in self-referential or
+to zero.  (Note: the reference counts for values in self-referential or
 cyclic data structures may not go to zero without a little help; see
-L<perlobj/"Two-Phased Garbage Collection"> for a detailed explanation.
+L<perlobj/"Two-Phased Garbage Collection"> for a detailed explanation.)
 If that thing happens to be an object, the object is destructed.  See
 L<perlobj> for more about objects.  (In a sense, everything in Perl is an
 object, but we usually reserve the word for references to objects that
@@ -120,6 +120,15 @@ reference to it, you have these options:
     sub hashem {       +{ @_ } }   # ok
     sub hashem { return { @_ } }   # ok
 
+On the other hand, if you want the other meaning, you can do this:
+
+    sub showem {        { @_ } }   # ambiguous (currently ok, but may change)
+    sub showem {       {; @_ } }   # ok
+    sub showem { { return @_ } }   # ok
+
+Note how the leading C<+{> and C<{;> always serve to disambiguate
+the expression to mean either the HASH reference, or the BLOCK.
+
 =item 4.
 
 A reference to an anonymous subroutine can be constructed by using