diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-05-15 06:16:13 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-05-15 06:16:13 +0000 |
commit | ebc58f1ae3702319e4a289ddf12b65aa41e620b0 (patch) | |
tree | a988e2b8b31c803349a100a8c38563c107334173 /pod/perlref.pod | |
parent | a1dd93259a6bf8541f88c948d6f510cc5090ff8e (diff) | |
download | perl-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.pod | 9 |
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 |