$string = 'polar bear'; $string = uc $string; ## make all-uppercase $string =~ s/.{3}$/lc $&/e; ## lowercase 3 chars at end