Re: the new raku.org is really beautiful (and tought about spurt)

[email protected] (Elizabeth Mattijsen) Mon, 8 Sep 2025 11:36:32 +0200
Newsgroups perl.perl6.users
Message-ID <[email protected]>
> On 8 Sep 2025, at 11:29, Marc Chantreux <[email protected]> wrote:
> so my dream would be to write liz's example close to this:
> 
> "example.txt".IO.slurp
> .&{ g:s/Hello/Hi/ }
> .spurt: $filename

The reason this doesn't work, is because  s:g/Hello/Hi/  requires a writeable $_, and the invocant of .&{  } is not writeable in this example.

If you really like s/// syntax that much, why not use   .subst(/Hello/, "Hi", :g)   instead?