You are viewing the version of this documentation from Perl blead. This is the main development branch of Perl. (git commit 3c2aa9fef064d0f6a90cb7999b1ca7a4fac4be3a)
ucfirst EXPR
ucfirst

Returns the value of EXPR with the first character in uppercase (Unicode calls this titlecase). If EXPR is omitted, ucfirst uses $_.

my $str = ucfirst("hello world!"); # "Hello world!"

This function behaves the same way under various pragmas, such as in a locale, as lc does.

Note: This is the internal function implementing the \u escape in double-quoted strings.

my $str = "\uperl\E is great"; # "Perl is great"