The y operator in Perl translates all characters of SearchList into the corresponding characters of ReplacementList.
Here the SearchList is the given input characters which are to be converted into the corresponding characters given in the ReplacementList.
Returns: the translated string
Example 1: This example uses y operator for translating from lower case to upper case.
GFG IS A COMPUTER SCIENCE PORTAL GEEKSFORGEEKS
Example 2: This example uses y operator for translating from upper case to lower case.
gfg is a computer science portal geeksforgeeks
Example 3: This example uses y operator for translating from upper case to numeric form.
656 89 0 29999949 9284924 999909 6449959964499
- Perl | Basic Syntax of a Perl Program
- Perl Tutorial - Learn Perl With Examples
- Perl | lt operator
- Perl | qw Operator
- Perl matching operator
- Perl | qq operator
- Perl | print operator
- Perl | redo operator
- Perl | q operator
- Perl | substitution Operator
- Perl | next operator
- Perl | cmp Operator
- Perl | gt operator
- Perl | le operator
- Perl | ge operator
- Perl | eq operator
- Perl | ne operator
- Perl | tr Operator
- Perl | split() Function
- Perl | chomp() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.