$author = join '; ', map { join ' ', reverse split /, / } split /; /, $author; #### $author =~ s/([^,;]+),([^,;]+)/$2 $1/g;