in reply to Re: Searching and Replacing file content within directory
in thread Searching and Replacing file content within directory

> I cannot find any information about what you are supposed to assign to $^I if you don't want backup files--maybe a blank string?

Your guess is correct - setting $^I to an empty string overwrites the original file, no backups.


--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf
  • Comment on Re^2: Searching and Replacing file content within directory

Replies are listed 'Best First'.
Re^3: Searching and Replacing file content within directory
by 7stud (Deacon) on Nov 27, 2010 at 20:12 UTC

    Thanks for confirming that. Just one correction: there's never any "overwriting" of the original file--a new file is always created. It's just that when you assign a blank string to $^I, perl doesn't save a copy of the original file before renaming the new file to the original file name.