Larry Wall wrote:
>On Tue, Apr 11, 2006 at 12:26:13PM +1200, Sam Vilain wrote:
>: This does mean that if you comment out blocks with s/^/#/, you mess up on:
>:
>: #sub foo
>: #{
>: # if foo { }
>: #}
>
>Well, actually, that still works.
>
>
Oh, true :-)
But this fragment dies:
#sub foo
#{
# bar { } unless baz
#}
Unless you consider the idea of balancing the {}'s inside the comment,
which I think would be just plain nasty.
The #* .. *# form actually has a natural follow-on I didn't think of before:
#[ This is a comment ]#
#( This is a comment )#
#{ This is a comment }#
#< This is a comment >#
#« This is a comment »#
While technically the same thing applies to code that uses these delimited, it
means that the block I gave is now a parsefail. #-comments directly following
closing braces are probably sufficiently uncommon for this not to be such a
problem.
>To be certain though, you could always
>use s/^/##/ or s/^/# /.
>
>
I guess that works, but it breaks convention of # somewhat.
>Even better is:
>
> =begin UNUSED
> sub foo
> {
> if foo { }
> }
> =end UNUSED
>
>And I don't really care if that's not what people are used to.
>The whole point of Perl 6 is to change How Things Work.
>
>
Sure, but there is still the principle of least surprise to worry about.
Sam.