$string = "Internal Computing Department"; $string =~ s/(\w)\w*/$1\./g; print $string ; #OUTPUT I. C. D.