I am piping ls into perl looking for lines that contain some any characters followed by ".mp4.mp3" at the end of the line. I want to remove the ".mp4" from the middle of the line. Here is my command:
ls | perl -pe 's|(.+?)\.mp4\.mp3$|\1\.mp3|'
If by 'operating on lines without ".mp4" in them at all' you mean you only want to print out filenames that the substitution changes, you need to not use -p and explicitly print the ones you want:
ls | perl -wne'print if s/\.mp4\.mp3$/.mp3/'