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:
Kent Fredric
Date:
March 6, 2016 09:41
Subject:
Re: [perl #127640] RFE: "qqw( $var/x $var/y word3 $var4=word4 )"
Message ID:
CAATnKFD04r9v6EXcoBDzF0cC6kNJ9rbYCF4xnWGBJZ8s6bgNog@mail.gmail.com
On 6 March 2016 at 22:18, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
> There’s little point in adding yet another way of writing that, when the
> other kind of result incurs a per-item punctuation tax:
>
>     (
>         "$prefix/foo",
>         "$prefix/bar",
>         "$prefix/baz",
>         "$prefix/quux",
>         "$prefix/qux",
>         # ...
>     );
>
> (And that’s the least noisy way of formatting it.)
>
> So that is the case that ought to gain some syntactic relief, if any.
>
> Hope I did a better job this time.


Agreed, so we are both proponents of "preserving"-qqw.

> preserving-qqw:  variables with spaces in them are treated as
> syntactically atomic and indivisible, and any spaces in them are
> treated as non-spaces for the purpose of the qqw construct, and only
>literal spaces in qqw itself is a separator

The only residual question I have is, what does this do:

@x = ('word','word with space');
@z = qqw(   @x  not-touching @{x}touching );

I assume that the "most obvious" thing would be this to compile the same as:

@z = (
   "@x",
  "not-touching",
  "@{x}touching",
);



-- 
Kent

KENTNL - https://metacpan.org/author/KENTNL

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