in reply to How do I modify a line within the file itself?

Accuracy compels me to point out that within a week or so after I recommended File::Slurp::Tiny in this thread, its author released a new version with a "USE OF THIS MODULE DISCOURAGED" message at the top of the documentation.

I withdraw my recommendation, even though I have personally never had a problem using the module.

The way forward always starts with a minimal test.