perl -e'$text="now is the time for all good women."; $text =~ s/^([a-z])/\u$1/;print $text . "\n";print $1 . "\n"' # outputs 'Now is the time for all good women.' and then 'n' on the next line