Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Dealing with Names

by kyle (Abbot)
on Aug 28, 2008 at 18:57 UTC ( [id://707560]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://707560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-19 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found