in reply to Re^3: the variable is lost
in thread the variable is lost

FWIW, using $a and $b outside of sort is always a mistake
The special variables $a and $b are also used by List::Util's reduce function and by List::MoreUtils's pairwise function.