lc

lc EXPR
lcThis function returns a lowercased version of
EXPR. This is the internal function
implementing the \L escape in
double-quoted strings.
Do not use lc for
case-insensitive comparisons the way you may have once done in ASCII,
because it gives the wrong answer for Unicode. Instead, use the fc (foldcase) function, either from the CPAN
Unicode::CaseFold module, or via use feature
"fc" in v5.16 or later. See the section “A Case of Mistaken
Identity” in Chapter 6 for more information.
Codepoints in the 128–256 range are ignored by lc if the string does not have Unicode
semantics (and locale mode is not in effect), which can be difficult to
guess. The unicode_strings feature
guarantees Unicode semantics even on those codepoints. See Chapter 6.
Your current LC_CTYPE locale is
respected if use locale is in effect,
though how locales interact with Unicode is still a topic of ongoing
research, as they say. See the perllocale,
perlunicode,
and perlfunc
manpages for the most recent results.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access