On Sat, Nov 14, 2020 at 01:59 ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Hi All,
>
> I am writing out an array of text lines to a file.
> I just can't help but thinking I am doing it the
> hard way.
>
>     unlink( $Leafpadrc );
>     for @LeafpadrcNew -> $Line  { spurt( $Leafpadrc, $Line ~ "\n",
> :append ); }
>

Unless I misunderstand, why doesn't this work:

    my $fh = open $Leafpadrc, :w;
    $fh.say($_) for @Leafpadrc;

-Tom

Reply via email to