in reply to how to make sed case INsensitive

Well, considering this is perlmonks, not sedmonks, I can give you a solution that happens to use perl intrinsically rather than spawning sed.
open F1, "< $write" or die $!; open F2, "> $write2" or die $!; while (<F1>) { s/$search/$replace/ig; print F2 $_; } close F1; close F2;
Depending on what you're doing, you might be able to avoid the external files altogether.

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.