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

Re: Problem in printing lastname and firstname

by joaocoutinho (Novice)
on Nov 18, 2006 at 23:30 UTC ( [id://584898]=note: print w/replies, xml ) Need Help??


in reply to Problem in printing lastname and firstname

How about doing something like the code below to discard anything the user types between the first and the last names?

#!/usr/bin/perl chomp(my $full_name = <STDIN>); my @names_list = split(/ /, $full_name); my $name_elements = scalar(@names_list); print "$names_list[$#names_list], $names_list[0]\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (11)
As of 2024-04-18 16:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found