in reply to simpler regex
$name =~ s/\b([a-z])\b/$1\./gi; [download]
Hope this helps RL
update: Sorry, missed corion's answer