in reply to Re^2: Dealing with Names
in thread Dealing with Names

I think betterworld has given a pretty simple and elegant solution. Given the code you posted in Re^2: Dealing with Names, you could adapt betterworld's code like so:

my $name_count = scalar split / /, $new_gecos; my @comps = $new_gecos =~ m{(?:Von|De La|La).*|\w+}g; push @comps, '' while scalar @comps < $name_count;

The first and third lines are only there to give you the blank array elements you apparently want. I'm putting in an empty string there, but maybe you want undef. Season to taste.