What is the uc() function in Perl?
The uc() function in Perl converts a string to uppercase.
The following figure shows a visual representation of the uc() function.
Syntax
uc(string)
Parameter
The uc() function requires only one parameter: a string that is to be converted to uppercase.
If the
stringparameter is omitted then it returns$_.
Return value
The uc() function returns a string that is converted to uppercase.
Code
The following code illustrates how to use uc() function in Perl.
#Stringprint "uc('educative') : ".uc('educative'). "\n";#String with numberprint "uc('educative09') : ".uc('educative09'). "\n";#String is omittedprint "uc() : ".uc(). "\n";