in reply to split by a capital followed by
Instead of using split you can just use a regular regex.
my $test = "JohnSmith"; my ($first, $last) = $test =~ /([A-Z][a-z]+)([A-Z][a-z]*)/; print "First: $first, Last: $last\n"; [download]