sub surname { # Assumes ASCII locale $_ = shift; return undef if (length($_) > 20); return $_ if /^([a-zA-Z]+)$/; # Surname is only one return $_ if /^[a-zA-Z]+ ([a-zA-Z]+)$/; # Surname only return undef; }