The name
variable may contain 2 words: template
or TEMPLATE
. Comparing both words (template
and TEMPLATE
) to "template" string gives TRUE
. For example, the code:
...
@name = split(/_/,$f,2);
print("$name[0]");
if ("$name[0]" == "template"){
print ("\n lowercase \n");
} elsif ("$name[0]" == "TEMPLATE") {
print ("\n UPPERCASE \n");
}
Results:
template
lowercase
TEMPLATE
lowercase
How to compare strings case-sensitively? Really appreciate your help.