my $string = "vorname nachname"; $string = join " ", map{ ucfirst $_ }split / /, $string; print $string;