use strict; my $text = "to say it once"; $text =~ s/(\w+)/\u\L$1/g; print $text; #### To Say It Once