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

Re: pre-RFC: template strings

Thread Previous | Thread Next
Ricardo Signes
June 18, 2022 00:12
Re: pre-RFC: template strings
Message ID:
On Wed, Jun 15, 2022, at 11:27, Philippe Bruhat (BooK) wrote:
> I like having different forms for explicitely providing context. If there is a single form (like the suggested `#{}`), then it probably should provide list context (since we only have the `scalar` keyword at our disposal).

I disagree, we also have "join", and I would suggest people use that to get a string form for a list.  It lets us say that…
qt{This is #{$how_cool} cool.}

…is equivalent to…
q{This is } . ($how_cool) . q{ cool.}

I'm not strongly opposed to two forms, but I think that qt should be a compelling replacement for "..." in many or most cases, so interpolating simple things shouldn't feel like a chore.  (I think that {...} might even be better than #{...}.)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About