From: Gurusamy Sarathy Date: Fri, 15 May 1998 06:16:13 +0000 (+0000) Subject: [win32] add doc for C<+{}> vs. C<{;}> disambiguation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ebc58f1ae3702319e4a289ddf12b65aa41e620b0;p=p5sagit%2Fp5-mst-13.2.git [win32] add doc for C<+{}> vs. C<{;}> disambiguation p4raw-id: //depot/win32/perl@980 --- diff --git a/pod/perlref.pod b/pod/perlref.pod index 51807e2..34c071f 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