i have ammended the code as follows but am still getting to fullstops at the end i.e. R.J..
sub shorten_initial()
{
@names = (split /\,/, $_[0]);
$init = "";
foreach $name (@names){
$init = $init . substr($name,0,1) . ".";}
$init=~s/\.\./\./g;
return $init;
}
Any ideas...
Hello
I am trying to perform an operation on a string variable such as John,Leslie,Smith and get J.L.S. i.e. just the initials out.
This is driving me round the bend any help would be appreciated.
Many thanks
Helen
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.