use locale; my $string = "vorname nachname öhhh"; $string =~ s/\b([[:alpha:]])/\U$1/g; print $string;