in reply to Re^2: Concatenate and join
in thread Concatenate and join

It's not possible to use the same trick. You want to concatenate the two groups every time, but skip the dot sometimes. Maybe with eval:
s/(\w+):(\w+)(:?)/ $1 . $2 . '.' x !!$3 /ge;

or use two steps (which makes it similar to your solution):

s/(\w+):(\w+)/$1$2/g; tr/:/./;

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,