pop @name_parts; # throw last name away
Look at the OP's list of names again: some of them are only first names. This code throws "Kurt" away completely, as well as "Jo" in the second "Mary Jo".
Update: That line can be replaced by:
pop @name_parts if $name_parts[-1] =~ /^[a-zA-Z]\.?$/;In reply to Re^4: Parsing out first names
by Not_a_Number
in thread Parsing out first names
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |