I think the original poster is referring to the fact that they didn't need
but they did need
my $d , etc etc
The reason for this is that $a and $b are global variables which are used by the sort function.
See perldoc -f sort for more
--- start quote ---
If the subroutine's prototype is "($$)", the elements to be
compared are passed by reference in @_, as for a normal
subroutine. This is slower than unprototyped subroutines, where
the elements to be compared are passed into the subroutine as
the package global variables $a and $b (see example below). Note
that in the latter case, it is usually counter-productive to
declare $a and $b as lexicals.
-- end quote ---