|
|
Tutorials

Perl

|
Topic |
What is y/// Operator in Perl?
|
|
Explanation |
|
The y/// Operator is used to transliterate string.
Syntax:
y/search list/replace list/options;
In the above syntax, "search list" is the string to be searched for, "replace list" is the string to
be replaced, "options" are optional arguments.
Example:
#! C:\programfiles\perl\bin\perl
print "content-type: text/html\n\n";
$string = 'maurice mike is the father of morris mike';
$string =~ y/abcde/ABCDE/;
print $string;
Result:
mAuriCE mikE is thE fAthEr of morris mikE
In the above y/// Operator for transliterate string example the smaller case string "abcde" is replaced with uppercase "ABCDE" in the string.
|
|
A Note |
|
Simple introduction, basic CGI perl programming codes with examples.
Do send your feedback or suggestions on this tutorial.
This is a copyright content.
|
|
|
|