- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

12.4 Modifiers

A number of backslash sequences have to do with changing the character, or characters following them. \l will lowercase the character following it, while \u will uppercase (or, more accurately, titlecase) the character following it. (They perform similar functionality as the functions lcfirst and ucfirst).

To uppercase or lowercase several characters, one might want to use \L or \U, which will lowercase/uppercase all characters following them, until either the end of the pattern, or the next occurrence of \E, whatever comes first. They perform similar functionality as the functions lc and uc do.

\Q is used to escape all characters following, up to the next \E or the end of the pattern. \Q adds a backslash to any character that isn't a letter, digit or underscore. This will ensure that any character between \Q and \E is matched literally, and will not be interpreted by the regexp engine.

Mnemonic: Lowercase, Uppercase, Quotemeta, End.

ISBN 9781906966027Perl Language Reference ManualSee the print edition