Hi,

For

Rissman, R.; Poon, W. W.; Blurton, M.; Oddo, S.; Torp, R.

I wish to get the output as

R. Risman and W. W. Pooon and M.  Blurtoon and S. Oddoo and R. Toorp, R.

Here is the code I came up so far, which works partially


#!/usr/bin/env perl

use strict;
use warnings;
use 5.012;

my $str=$ARGV[0];


my @b = split /;/, $str;

foreach (@b){
        if (/([A-Z][a-z]+)\,[ ]([A-Z]\.+)/){
                print $2," ", $1, " and ";
        }
}

R. Risman and W. Pooon and M. Blurtoon and S. Oddoo and R. Toorp and

which missed the  W. W. Pooon.

Thanks ahead for your suggestion,

Best regards,

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to