my $string = "vorname nachname"; $string =~ s/\b([a-z])/uc($1)/eg; print $string;