$author = "Smith, Kristin A.; Shirley, Mark Harper ; Saff, David ; Ernst, Michael D.; Patrick, Nicholas J. M ; Yu, (Jeffrey) Hu; De La Macorra, F ; Smith, Meghan. ";
this variable has author names , but my target is to change the order of individual author, like "Smith, Kristen A." should change to "Kristen A. Smith".
I have used the following code::
@author = split(';', $author);
$ca = scalar(@author);
for (my $i=0; $i<$ca ; $i++)
{
($a, $b) = split(',', $author[$i]);
$author[$i] = "$b$a";
}
$author = join(',', @author);
print "$author\n";
i find this code really complex. Please suggest a better code using map function.