in reply to inserting into html files
There are all kinds of things in that regex that don't need to be there.
You don't need to escape the slashes if you don't use slash as the delimiter:s|foo|bar|, s#foo#bar#, s{foo}{bar} for instance.
You also don't need brackets around either side, or to escape the double quotes inside the single-quotes, so instead of
you could just use:s/(<head>)/(<head><meta http-equiv=\"Content-Type\" content=\"text\/html; charset=ISO-8859-1\"\/>)/gi
s|<head>|<head><meta http-equiv="Content-Type" content="text\/html; charset=ISO-8859-1" />|gi
The above works for me.
($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print
|
|---|