in reply to generate list from users first name and name?
use utf8;
use Text::Unidecode qw(unidecode);
sub short {
my @s = split ' ', (lc unidecode($_[0]) =~ tr/-//dr);
$s[0] = substr $s[0], 0, 1;
return join '', @s;
}
sub long {
return lc unidecode($_[0]) =~ tr/ /./r =~ tr/-//dr
}
printf "%s\t%s\t%s\n", $_, short($_), long($_) for (
'Ævar Arnfjörð Bjarmason',
'Jérôme Mustermann',
'Max Maier',
'Rafaël Garcia-Suarez',
'Rafael van der Vaart',
'विश्वनाथन आनंद',
'周潤發',
);
I can guess what you're up to. Don't just create account names! During sign-up, give these transformed names out as a suggestion, then let people confirm/change them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: generate list from users first name and name?
by Skeeve (Parson) on Sep 14, 2012 at 15:29 UTC | |
by Your Mother (Archbishop) on Sep 14, 2012 at 16:36 UTC | |
|
Re^2: generate list from users first name and name?
by matze77 (Friar) on Sep 14, 2012 at 13:04 UTC | |
by daxim (Curate) on Sep 14, 2012 at 17:46 UTC |