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


in reply to Question regarding options like -i -n -p

I am not sure of what you want exactly, but if you want to get rid of bakcup files, you can do something like this:

$ perl -i.bak -pe 's/ /  /g; END {unlink "*.bak"}' file.txt

This is *nix syntax, but I guess you could have this untested equivalent under Windows:

perl -i.bak -pe "s/ /  /g; END {unlink qq/*.bak/}" file.txt