hi William,
On Sun, Sep 07, 2025 at 07:26:21PM -0700, William Michels via perl6-users wrote:
> `~$ raku -e 'my $fh = "ImportantFile_bak".IO; #create filehandle \
>"ImportantFile".IO.slurp.subst(:global, "Hello ", "Hi ") andthen
> spurt($fh, $_, :createonly);' `
this is way behond t
On Mon, Sep 08, 2025 at 11:36:32AM +0200, Elizabeth Mattijsen wrote:
> 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.
AFAIR, there was also problems with the way I split the lines because
it changed
> On 8 Sep 2025, at 11:29, Marc Chantreux 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
> On 8 Sep 2025, at 04:26, William Michels wrote:
> PS If `Str` had a `spurt` method, wouldn't you be in constant fear of a
> sensitive string literal (e.g. a password) being accidentally written to disk?
How would that be different from the fear of $io.spurt($sensitive-data) ??