Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL y/// Function
Syntax
y/SEARCHLIST/REPLACEMENTLIST/
|
Definition and Usage
Identical to the tr/// operator; translates all characters in SEARCHLIST into the corresponding characters in REPLACEMENTLIST. It does character by character conversion
Return Value
Example
#!/usr/bin/perl -w
$string = 'the cat sat on the mat.';
# This will generate a upper case string
$string =~ y/a-z/A-Z/;
print "$string\n";
|
It will produce following results:
|

|
|
|