Can't use "my %s" in sort comparison (F) The global variables $a and $b are reserved for sort compar- isons. You mentioned $a or $b in the same line as the <=> or cmp operator, and the variable had earlier been declared as a lexical variable. Either qualify the sort variable with the package name, or rename the lexical variable.