summaryrefslogtreecommitdiff
path: root/pod/perlref.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-15 06:16:13 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-15 06:16:13 +0000
commitebc58f1ae3702319e4a289ddf12b65aa41e620b0 (patch)
treea988e2b8b31c803349a100a8c38563c107334173 /pod/perlref.pod
parenta1dd93259a6bf8541f88c948d6f510cc5090ff8e (diff)
downloadperl-ebc58f1ae3702319e4a289ddf12b65aa41e620b0.tar.gz
[win32] add doc for C<+{}> vs. C<{;}> disambiguation
p4raw-id: //depot/win32/perl@980
Diffstat (limited to 'pod/perlref.pod')
-rw-r--r--pod/perlref.pod9
1 files changed, 9 insertions, 0 deletions
diff --git a/pod/perlref.pod b/pod/perlref.pod
index 51807e2b8d..34c071fcfe 100644
--- a/pod/perlref.pod
+++ b/pod/perlref.pod
@@ -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