in reply to how to nullify case sensitivity

Use lc or uc to normalise the strings you want to compare:

if (lc $var1 ne lc $var2) { ... }

Note by the way that $a and $b are special variables used by sort and should generally not be used for other purposes - even in example code.

True laziness is hard work