Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Problem in printing lastname and firstname

by joaocoutinho (Novice)
on Nov 18, 2006 at 23:30 UTC ( #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
Node Status?
node history
Node Type: note [id://584898]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2020-01-23 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?