develooper Front page | perl.perl5.porters | Postings from March 2016

Re: [perl #127640] RFE: "qqw( $var/x $var/y word3 $var4=word4 )"

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
March 11, 2016 00:01
Subject:
Re: [perl #127640] RFE: "qqw( $var/x $var/y word3 $var4=word4 )"
Message ID:
20160311000053.GA27351@debian
* Aristotle Pagaltzis <pagaltzis@gmx.de> [2016-03-05T16:59:38]
> > On Sat Mar 05 10:14:48 2016, perl.p5p@rjbs.manxome.org wrote:
> > > $x = "good job";
> > > @y = qqw( $x hunter );
> > >
> > > Is @y now ('good', 'job', 'hunter') or ('good job', 'hunter')?
> > > I would think the latter.
> >
> I prefer the [latter].

Me, too.  Other cases to consider:

  @x = qqw(  abc @def ghi );

...which would need to have three elements, to match this:

  @x = qqw(  x:abc x:@def x:ghi  );

It would be bizarre for the second example to only have x: on the first element
from @def.  If @def is empty, it ought to become "", similarly.

Someone will probably have to stop and think about:

  @x = qqw(
    abc
    $def->{ ... ... ... }
    ghi
  );

...because of the spaces in the expr in the second element.  I think this is
okay.

> While we’re at it – I would also prefer qqw() to allow comments, and/but
> allow backslashing whitespace and octothorpes to demote them from syntax
> to string content.

Agreed.

> Oh, and please – no qw()-style warnings about commas.

I have no feelings on this.

-- 
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