my @in = qw(aaa bbb ccc); my @out = map { s/.$/x/ } @in; print "@in\n=>\n@out\n";