The
p and the
i are seperate options. You definitely want to keep the
p, and you definitely want to keep the
i ("inplace"), but if you don't specify an extention, the backup file isn't created. This is all documented in
perlrun.
perl -pi -e 's/apple/orange/gi'
Caveat: i without an extention does not work in Windows.