Author: lwall Date: 2009-09-28 04:44:17 +0200 (Mon, 28 Sep 2009) New Revision: 28444
Modified: docs/Perl6/Spec/S12-objects.pod Log: [S12] require parens on .'method'() form Modified: docs/Perl6/Spec/S12-objects.pod =================================================================== --- docs/Perl6/Spec/S12-objects.pod 2009-09-27 17:32:48 UTC (rev 28443) +++ docs/Perl6/Spec/S12-objects.pod 2009-09-28 02:44:17 UTC (rev 28444) @@ -13,8 +13,8 @@ Created: 27 Oct 2004 - Last Modified: 7 Sep 2009 - Version: 87 + Last Modified: 27 Sep 2009 + Version: 88 =head1 Overview @@ -296,8 +296,12 @@ $obj."$methodname"(1,2,3) # use contents of $methodname as method name $obj.'$methodname'(1,2,3) # no interpolation; call method with $ in name! - $obj!"$methodname" # indirect call to private method name + $obj!"$methodname"() # indirect call to private method name +As an aid to catching Perl 5 brainos, this quoted form always requires +a parenthesized argument list to distinguish it from code that looks +like a Perl 5 concatenation. + Within an interpolation, the double-quoted form may not contain whitespace. This does what the user expects in the common case of a quoted string ending with a period: @@ -307,7 +311,7 @@ If you really want to call a method with whitespace, you may work around this restriction with a closure interpolation: - say "Foo = {$foo."a method"}"; # OK + say "Foo = {$foo."a method"()}"; # OK [Note: to help catch the mistaken use of C<< infix:<.> >> as a string concatenation operator, Perl 6 will warn you about "useless use of