Perl question:
I want to replace one string with the other; both are of the same length. I want to replace all occurrences of the string (case insensitive), but I want that the case of the letter will be preserved. So if the first letter was upper case, the first letter after the replacement will be upper case also.
For example, if I want to replace "foo" with "bar", so I want that
foo ==> bar
Foo ==> Bar
FOO ==> BAR
Is there a simple way to do this in Perl?
Thanks.