in reply to in place edit - how to do

It says cannot do inplace edit without backup at line 9
If you get an error message you don't understand, use diagnostics can offer extra explanation, or you can just look the error up in perldiag

In this case, you would have read:

Can't do inplace edit without backup (F) You're on a system such as MS-DOS that gets confused if you try reading from a deleted (but still opened) file. You have to say "-i.bak", or some such.

Replies are listed 'Best First'.
Re^2: in place edit - how to do
by ikegami (Patriarch) on Jan 14, 2009 at 23:06 UTC
    The diagnostic message is wrong in this case. Windows is quite able to read from deleted (but still opened) files. It just can't can't create a new file with the same name until all handles to it are closed. The solution is appropriate, though.
      Patches welcome :-)

        Can't. Like I said, it's not supported by the OS, but for a different reason than the one mentioned in the diagnostic message.

        It would be possible to do using a temporary file or by slurping the file into memory. This former would also allow undoing the edit in case of error. This has been proposed on the p5p and has gained some traction. The discussion was tracked in RT 1154

        Update: Oh! I just realized you meant patching the message.