in reply to Author separation
Many ways of doing this, here is mine:
Gives:use strict; use warnings; my $author = "Cheng, Liying, Fox, Janna., and Zheng, Ying. "; $author =~ s/\.| and| //g; my %hash = split (',', $author); my @authors; for my $key (sort keys %hash) { push @authors,"$hash{$key} $key"; } $author = join(',', @authors); print "$author\n";
Liying Cheng,Janna Fox,Ying Zheng
|
---|
In Section
Seekers of Perl Wisdom