Note because files are slurp()-ed in (i.e. read into memory all at once), you might run into memory limits for exceedingly large files. This could be circumvented by opening a filehandle and appending modified lines linewise (however, you'll lose the ability to doin general this makes multi-line substitutions more complicated). See https://docs.raku.org/language/io-guide for details.