When sort calls 'byVersion' it sets up $a and $b as
package global variables. So these variables are used
more than once -- when they are being set and when they
are being used.
If you add the line
use vars qw/$a $b/;
you 'declare' these variables as main package globals
and you should get rid of the warning.