in reply to Changing the order of elements in the variable
$author = join '; ', map { join ' ', reverse split /, / } split /; /, $author;
Or as a regex substitution:
$author =~ s/([^,;]+),([^,;]+)/$2 $1/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Changing the order of elements in the variable
by bimleshsharma (Beadle) on May 30, 2012 at 11:01 UTC | |
by kcott (Archbishop) on May 30, 2012 at 11:30 UTC |