in reply to String replace

perhaps some variant on this?
my @random_names = qw /AAA BBBBB CCCCC DDDDDD/; $s =~ s/[A-Z]{3,}/$random_names[int rand $#random_names]/sg;
note: i assumed your products would be at least 3 characters and only have A-Z in them (i.e. no dash, underscore, numbers, etc).
Similarily, you could replace with a hash lookup if you want all of product NNNNN replaced with the same thing.