That eq definitely does not make sense. I can guess what was in your mind, you probably thought that by using 'eq', sort will group elements for you base on how common they are. No, that is not what sort does. You have to tell sort "between each pair of two elements, how they shall be ordered".
You are looking for something like:
my @list = ('10.1.1.1', '10.1.1.2', '10.2.2.1', '10.2.2.2');
@list = sort intermix @list;
substr( $a, 0, rindex($a, '.'))
substr( $b, 0, rindex($b, '.'))
? 1 : 0;