use Lingua::EN::NameCase qw( nc ); use strict; while () { 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 #### 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