Just a simple question I want to ask. I am beginner for Perl script, sorry if you feel this question is stupid.
The question is can I return a variable and apply "uc" when return.
Here is the code:
my $desc = "";
@names = ("thor-12345-4567");
$size = @names;
Thor();
print $desc;
sub Thor() {
if ($size ne "0") {
return uc ($desc=$names[0]);
}
$desc = "NA";
return $desc;
}
I just want to know that is "uc" can be use when we return to a variable?
When I try to print $desc, it did not return to uppercase.
Thank you very much!