open OUT, "> index.html" or die "$!"; # open the new HTML file
open IN, "index.html.old" or die "$!"; open the old HTML file to be read in
while () {
s/@xyz\.com/@xyzabc\.com/g; #for every line that has @xyz.com replace it with @xyzabc.com
print OUT; # print the line into the new HTML file
}
close IN or warn "$!"; # close the old file
close OUT or warn "$!"; # close the new file