http://www.perlmonks.org?node_id=995985


in reply to Diamond or Open, Process, Close?

Perl's -i mode creates a new file and then renames the new file as the old file. That might give you problems if you are not the owner of the file, as both file owner and modes may, and likely will, change.

Besides, open (or sysopen) is the low level operator that perl uses internally. What you are asking is similar to asking "Should I write my own code, or use a module?" except that here, the "module" (the implementation of the <> operator) is built into Perl itself.