lc - perldoc.perl.org

Perl Programming Documentation
Download Perl
Explore

Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

Tools

- Preferences

# lc

Perl 5 version 12.2 documentation
Go to top
Show recent pages
Recently read

# lc

Perl functions A-Z | Perl functions by category | The 'perlfunc' manpage

- lc EXPR

- lc

  Returns a lowercased version of EXPR. This is the internal function implementing the `\L` escape in double-quoted strings.

  If EXPR is omitted, uses `$_` .

  What gets returned depends on several factors:

  - If `use bytes` is in effect:
    - On EBCDIC platforms

      The results are what the C language system call `tolower()` returns.

    - On ASCII platforms

      The results follow ASCII semantics. Only characters `A-Z` change, to `a-z` respectively.

  - Otherwise, If EXPR has the UTF8 flag set

    If the current package has a subroutine named `ToLower` , it will be used to change the case (See User-Defined Case Mappings in perlunicode.) Otherwise Unicode semantics are used for the case change.

  - Otherwise, if `use locale` is in effect

    Respects current LC_CTYPE locale. See perllocale.

  - Otherwise, if `use feature 'unicode_strings'` is in effect:

    Unicode semantics are used for the case change. Any subroutine named `ToLower` will not be used.

  - Otherwise:
    - On EBCDIC platforms

      The results are what the C language system call `tolower()` returns.

    - On ASCII platforms

      ASCII semantics are used for the case change. The lowercase of any character outside the ASCII range is the character itself.