substr($s, 0, rindex($s, ".")) =~ y/./_/; [download]
In reply to Re: Replace all occurrences but the last by ysth in thread Replace all occurrences but the last by kiat