in reply to Re^6: Delete a line from files
in thread Delete a line from files

It doesn't work. The diamond operator opens the file and reads from it at the same time, you can't first open the file and then set the variable. Check the difference yourself:
perl -pwe '$^I = ".bak"; s/[<>]/|/g' file1 perl -pwe 'BEGIN { $^I = ".bak" } s/[<>]/|/g' file2
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ