Perl – Uppercase to Lowercase Conversion via the Translation Operator


Perl’s translation operator provides a way to substitute one group of characters for another. In the below script I demonstrate how easy it is to use the translation operator to convert standard input from the command prompt from uppercase letters to lowercase. You can also use Perl’s lc() function to accomplish the same thing more easily.

Perl's translation operator

Perl's translation operator


Output:
Uppercase to lowercase via Perl's translation operator

Uppercase to lowercase via Perl's translation operator

Twitt

Tags: , , , , , , , , , , , ,

Leave a Reply

*


one × 8 =