http://www.perlmonks.org?node_id=175645


in reply to Inserting a single-quote into a file

Yup, it's a shell quoting problem. Switch up the quotes:

perl -pi -e"s/ where/' where/g" *.sql

..works fine.

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'