Paul Hodges wrote:
> http://perl6.org/doc/design/syn/S02.html still says:
> "Intra-line comments will not be supported in standard Perl"
This is wrong, since S02 also defines intra-line comments, under
"Whitespace and Comments". It calls them 'embedded comments'. You
don't need a 'use' statement.
> Is there any restriction of the whitespace *inside* the comment?
Not from my reading of it, no.
> And is / a valid bracketer?
No. The valid bracketers are defined under "Lexical Conventions" - in
layman's terms, bracketing characters are matching pairs of
characters: so '(' and ')' are bracketing characters, but '/' is not.
Likewise, the matches are based on individual characters, so if you
use "<--" at the start of a bracketed segment, only the "<" counts as
a bracketing character.
> or should I stick to things like
>
> $x = #<-- comment --> 1;
> $x = #{ comment #} 1;
> $x = #( comment +) 1;
> $x = #[ comment =o] 1;
>
> Or will any of these not work?
All four of those work as written.
In addition, S06 demonstrates how you can use macros to create custom
embedded comments:
macro circumfix:«<!-- -->» ($text) is parsed / .*? / { "" }
<!-- this is now a comment -->
--
Jonathan "Dataweaver" Lang