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

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

Thread Previous | Thread Next
From:
Ed Avis
Date:
September 19, 2011 02:24
Subject:
Re: [perl #93640] Allow comments in qw()
Message ID:
loom.20110919T112240-903@post.gmane.org
Peter Makholm <peter <at> makholm.net> writes:

>>qw() is inconsistent with the rest of Perl which defines whitespace to
>>include comments.
>
>Isn't it quite consisten with the default handling of # in all the other
>quote like operators. Neither tr/// nor qx// have any special handling
>making '#' used for comments.

Neither does m//, but you can give the /x modifier to allow comments.
So perhaps qw//x should be the syntax for a quoted word list with # comments
stripped out.  That would be incompatible, though:

% perl -E 'say qw/a b/x 2'
abab

-- 
Ed Avis <eda@waniasset.com>


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