Quick and dirty:
#!/usr/bin/perl -w
use strict;
open(FILE, ";
close(FILE);
foreach(@lines) {
$_ =~ s//ABCD/g;
}
open(FILE, ">/tmp/yourfile.txt") || die "File not found";
print FILE @lines;
close(FILE);
Perhaps it i a good idea not to write the result back to your original file; instead write it to a copy and check the result first.