I have a bug report from a reliable person that on Cygwin and Perl 5.14.2, using perl's -i
switch with no value creates a .bak backup file. It shouldn't according to the documentation in perlrun:
If no extension is supplied, no backup is made and the current
file is overwritten.
I don't have access to Cygwin at the moment. Does anyone else see this behavior? Can you explain it? Is is something about creating the backup file, which should only be a temporary file, and failing to remove it?
Here's the steps I suggest to recreate it. Remember, this is for Cygwin:
perl -p -i -e 's/perl/Perl/g' filename
Save the answers for an explanation of what might be happening if you find that backup file. Upvoting a prior comment for "Yes I see that" or "No, can't reproduce it" can be an informal poll.
perldoc perlcygwin sayeth (edited for clarity):
Because of Windows-ish restrictions, inplace editing of files with
perl -i
must create a backup of each file being edited. Therefore Perl adds the suffix.bak
automatically — as though invoked withperl -i.bak
— if you useperl -i
with no explicit backup extension.
Arguably this information should be in perlport also.