Re: Q[] question

[email protected] ("Kevin Pye")
Newsgroups perl.perl6.users
Message-ID <[email protected]>
On Sun, 12 Jan 2025, at 14:01, ToddAndMargo via perl6-users wrote:
> Hi All,
>
> Is
>     Q[...]
>
> the same thing as
>     <...>
> ?

No.

Q[…] is the bare quoting construct. There'll be no interpolation of variables, no splitting into words, nothing other than creating a bare string.

But Q also takes various adverbs to add all the nice extra available features. <…> is the same as Q:w:v[…]. The :w will split the input into words and return a list rather than a single string. :v will create allomorphs where possible. For example the substring "12" will create an allomorph which can act as either the string "12" or the number 12.

The is all explained much better than I can in https://docs.raku.org/language/quoting

Kevin.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.