Your code doesn't work because you forgot return $key; in normalize_digits.
Also, I think you can speed things up by using the following:
my @sorted = map { local $_ = $_; s/^.*\0//; $_ } sort map { normalize_digits($_) . "\0$_" } @data;
In reply to Re^2: Sorting question
by ikegami
in thread Sorting question
by perl_seeker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |