in reply to Capitalizing letters?

This will capitalize the first letter after one hard return.
$_= " This is a paragraph here too."; s/(\n\w)/uc($1)/eg; print;
This will capitalize the first word after one hard return.
$_= " This is a paragraph here too."; s/(\n\w+)/uc($1)/eg; print;

Also, I can't find any reference to a \u escape sequence. Can someone help me understand what that should do, if anything?

Replies are listed 'Best First'.
Re: Re: Capitalizing letters? (boo)
by wog (Curate) on Jun 21, 2001 at 18:43 UTC
    The \u escape sequence is documented in perlop:

    The following escape sequences are available in constructs that interpolate but not in transliterations. \l lowercase next char \u uppercase next char \L lowercase till \E \U uppercase till \E \E end case modification \Q quote non-word characters till \E