On 2020-11-14 11:22, Fernando Santagata wrote:
On Sat, Nov 14, 2020 at 8:07 PM ToddAndMargo via perl6-users
<perl6-us...@perl.org <mailto:perl6-us...@perl.org>> wrote:
On 2020-11-14 06:00, Brad Gilbert wrote:
> The purpose of `spurt` is to:
> 1. open a NEW file to write to
> 2. print a single string
> 3. close the file
>
> If you are calling `spurt` more than once on a given file, you
are doing
> it wrong.
You are forgetting that spurt comes with an `:append` option.
Maybe this is what you want:
my @a = 1,2,3;
spurt('test', @a.join("\n") ~ "\n"); # join doesn't add the last "\n"
Or the equivalent
'test'.IO.spurt: @a.join("\n") ~ "\n";
--
Fernando Santagata
That is the way around the issue.
But my question is why can I not put the \n in the variable?