in reply to Make the first letter of each word capitalize
Use Lingua::EN::NameCase.
You're not dealing with words, it appears you're dealing with names. Therefore, use the below example in order to take advantage of all the special cases that ucfirst lc will miss.
The above code runs everything after the AU tag through nc and outputs the result, like so:use Lingua::EN::NameCase qw( nc ); use strict; while (<DATA>) { s/(?<=AU: )(.*)/nc $1/e; print; } __DATA__ AU: jane smith AU: JOHN DOE AU: keith miller AU: PHILLIP LEIGH-WILLIAMS AU: PAUL MCCARTNEY AU: DOUGIE O'CALLAGHAN AU: MARIE ST. JOHN AU: henry viii
- MillerAU: Jane Smith AU: John Doe AU: Keith Miller AU: Phillip Leigh-Williams AU: Paul McCartney AU: Dougie O'Callaghan AU: Marie St. John AU: Henry VIII
|
|---|