$paragraph = "This is a group of words. It mentions people like Joe Smith and Jill Doe who work at Aerodyne Laboratories, INC. The facility is located in Springfield, MA and is famous for it's llamas, lizards and Gork the giant robot."; @text = split(/\.[\s]*/,$paragraph); foreach $line(@text){ $line = lcfirst($line); $line =~ s/[A-Z][a-z]+/XXXXX/g; $line = ucfirst($line); } print join ". ", @text;