in reply to Replace all occurrences but the last
join _=>split/[.]/=>$_,y[.]__; [download]
Silly rabbit. :-) Nice approach, though.
# legible: join( "_", split( /\./, $_, y/.// ) ); [download]
The tr/// here counts the dots in the string and uses the number as a limit to split — since the number is one less than the number of fragments delimited by dots, the last dot in the string does not get to serve as a delimiter.
Makeshifts last the longest.