develooper Front page | perl.perl5.porters | Postings from June 2011

Re: [perl #93640] Allow comments in qw()

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 30, 2011 13:56
Subject:
Re: [perl #93640] Allow comments in qw()
Message ID:
20110630205538.GA7669@cancer.codesimply.com
* Jesse Vincent <jesse@fsck.com> [2011-06-30T13:25:18]
> 
> On Mon 27.Jun'11 at 12:38:28 -0700, Eric Brine wrote:
> 
> > Patch 3:
> > 
> > Add feature qw_comments, which allows comments to be used in the qw()
> > operator.
> 
> I'm not in favor of this one. It breaks my assumptions about
> what qw means. (Those being "This text will be split on whitespace
> boundaries but otherwise won't be touched")

I am not in favor of this change, but I will play devil's advocate very very
briefly:

  Aren't comments sometimes just line-ending whitespace?

My initial reply was going to be: I don't like making qw special, why not
comments in multiline qq strings?  But then the problem is that you don't know
what to do here:

  my $x = qq{
    Foo
    # bar
    Baz
  };

Are the two whitespace lines before # in the string itself?  This isn't a
problem in qw, where the whitespace is already gone.  Then again, it isn't in
qx, either...

Yup.  Still not in favor of this change, either.

-- 
rjbs

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About