in reply to Re^2: How does rename() work on read-only files?
in thread How does rename() work on read-only files?

Why did we get a different result

Perhaps you are running a different Perl version? From perl5280delta:

Previously in-place editing (perl -i) would delete or rename the input file as soon as you started working on a new file. ... This has changed so that the input file isn't replaced until the output file has been completely written and successfully closed. This works by creating a work file in the same directory, which is renamed over the input file once the output file is complete.

Replies are listed 'Best First'.
Re^4: How does rename() work on read-only files?
by j41r (Beadle) on Dec 12, 2018 at 00:21 UTC

    I didn't know that, thanks.