# remove all the character after last dot $line=~s/\.\w+$//o;