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


in reply to Re^2: case insensitive replace, but maintains capitalization
in thread case insensitive replace, but maintains capitalization

This script beautifully handles the first letter of the word. You'll still have to define the (complex) rules for this in case you need more than just first letter. For example if you want "animal" to be replaced by "pet" then what should "ANiMal" be replaced with?

-- Regards - Samar