my $test = "JohnSmith"; my ($first, $last) = $test =~ /([A-Z][a-z]+)([A-Z][a-z]*)/; print "First: $first, Last: $last\n";