while () [ chomp; s/(th)/TH/gi; print "$_\n"; } close (test);