Why do I have to specify the -i switch with a backup extension when using ActivePerl?

Posted by Zaid on Stack Overflow See other posts from Stack Overflow or by Zaid
Published on 2010-04-11T11:38:22Z Indexed on 2010/04/11 11:43 UTC
Read the original article Hit count: 365

I cannot get in-place editing Perl one-liners running under ActivePerl to work unless I specify them with a backup extension:

C:\> perl -i -ape "splice (@F, 2, 0, q(inserted text)); $_ = qq(@F\n);" file1.txt
Can't do inplace edit without backup.

The same command with -i.bak or -i.orig works a treat, but also creates an unwanted backup file in the process.

Has anyone else faced similar issues? Is there a way around this?

© Stack Overflow or respective owner

Related posts about perl

Related posts about activeperl