in reply to -i switch behaviour

If you pipe the output of ls into perl, you are really just giving it a string containing file names. You need to change that to:

perl -lpi -e 's/e/*/' testfile
In order to give perl the opportunity to scan @ARGV and then read the file contents.