On 2020-11-14 11:08, Curt Tilmes wrote:
On Sat, Nov 14, 2020 at 2:03 PM ToddAndMargo via perl6-users
<perl6-us...@perl.org> wrote:
Just out of curiosity, why is the \n printed out literally here?
p6 'my @x = <"aaa\n","bbb\n","ccc\n">; for @x {print @_};'

Your 'word quoting' <> is sort of like single quotes -- it keeps the
literal stuff.  You could
use <<>> which is more like double quotes,

Curt


or remove the commas.  I put everything in [0]


$ p6 'my @x = <aaa\n bbb\n ccc\n>; for @x {print "$_\n";}'
aaa\n
bbb\n
ccc\n

$ p6 'my @x = <<aaa\n bbb\n ccc\n>>; for @x {print "$_\n";}'
aaa
bbb
ccc

$ p6 'my @x = <<aaa\n bbb\n ccc\n>>; for @x {print "$_";}'
aaabbbccc

What am I missing?

-T

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to