Click to See Complete Forum and Search --> : How to detect upper and lower case of a same string in perl cgi?


Vincent001
04-16-2003, 08:02 PM
I want to know how to detect a string (ignore upper or lower case) with the data in arrays.

e.g.

$MyInput="CooL";
$a[1]="cool";


How to compare the above two variables to be equal.

i.e

If ($MyInput eq $a[1])
{
print "Equal";
}

jeffmott
04-16-2003, 08:10 PM
if (lc $MyInput eq lc $a[1]) {
print 'Equal';
}