Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 having an uproarious good time at the Monastery: (7)
As of 2019-07-16 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?