Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

q, qq and qx here-documents (for consistency with qt here-docs)

2 views
Skip to first unread message

Philippe Bruhat (BooK)

unread,
Jan 19, 2024, 4:45:05 AMJan 19
to Perl 5 Porters
Hi,

The current version of PPC 0019 proposes a here-doc version of `qt`:

> To provide a heredoc version of qt, this:
>
> <<qt{END} TEXT END
>
> will apply qt-like interpolation to TEXT.

Once this is implemented, a nice addition (mostly for consistency and
cuteness) would be to add support for `<<q` (single quotes here-doc),
`<<qq` (double quotes here-doc) and `<<qx` (backticks here-doc).

I note that perlop says:

> Additionally, quoting rules for the end-of-string identifier are
> unrelated to Perl's quoting rules. "q()", "qq()", and the like are not
> supported in place of '' and "", and the only interpolation is for
> backslashing the quoting character.

Adding support for q(), qq() and qx() in place of '', "" and `` to define
end-of-string identifiers (for consistency with the addition of qt() there)
would behave the same as the regular quotes already do in this case, with
the only interpolation being for backslashing the quoting character.

--
Philippe Bruhat (BooK)

The only certain bet in gambling is that it leads to more gambling
(Moral from Groo #11 (Image))

Paul "LeoNerd" Evans

unread,
Feb 1, 2024, 1:00:04 PMFeb 1
to perl5-...@perl.org
On Fri, 19 Jan 2024 10:36:49 +0100
"Philippe Bruhat (BooK)" <bo...@cpan.org> wrote:

> Adding support for q(), qq() and qx() in place of '', "" and `` to
> define end-of-string identifiers (for consistency with the addition
> of qt() there) would behave the same as the regular quotes already do
> in this case, with the only interpolation being for backslashing the
> quoting character.

Those seem like simple enough additions to add alongsite the qt
heredocs yes.

Currently looking at the schedule of things, I don't imagine I'm going
to get any time to work on qt now before v5.40 release so that'll have
to be a thing for v5.42 - or will we call it v7? I can always hope ;)

--
Paul "LeoNerd" Evans

leo...@leonerd.org.uk | https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/
0 new messages